-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (67 loc) · 1.77 KB
/
ci.yml
File metadata and controls
73 lines (67 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CI
on: [ push, workflow_dispatch ]
env:
TEST_TAG: tzelleke/plotly-dash-app:test
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- uses: chartboost/ruff-action@v1
- uses: hadolint/hadolint-action@v3.1.0
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
context: .
target: test
load: true
tags: ${{ env.TEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run pytest in container
run: |
set -o pipefail
mkdir share
docker run --rm -i \
-v $(pwd)/share:/root/pytest \
${{ env.TEST_TAG }} pytest
- name: Render coverage report to step summary
run: |
set -o pipefail
echo '# Coverage report' >> $GITHUB_STEP_SUMMARY
docker run --rm -i \
-v $(pwd)/share:/root/pytest \
${{ env.TEST_TAG }} coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docs:
- 'docs/**'
deploy-docs:
needs: changes
if: ${{ needs.changes.outputs.docs == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.x
- run: pip install \
mkdocs-material \
mkdocs-macros-plugin \
mkdocs-awesome-pages-plugin \
mkdocstrings \
mkdocs-mermaid2-plugin
- run: mkdocs gh-deploy --force