-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (92 loc) · 3.23 KB
/
test.yaml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: test and build docs
on: push
concurrency: test
env:
S3_HOST: ${{vars.S3_HOST}}
S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing!
S3_FOLDER: ${{vars.S3_TEST_FOLDER}} # testing!
S3_TEST_BUCKET: ${{vars.S3_TEST_BUCKET}}
S3_TEST_FOLDER: ${{vars.S3_TEST_FOLDER}}
ZENODO_URL: ${{vars.ZENODO_TEST_URL}} # testing!
ZENODO_TEST_URL: ${{vars.ZENODO_TEST_URL}}
S3_ACCESS_KEY_ID: ${{secrets.S3_ACCESS_KEY_ID}}
S3_SECRET_ACCESS_KEY: ${{secrets.S3_SECRET_ACCESS_KEY}}
ZENODO_API_ACCESS_TOKEN: ${{secrets.ZENODO_TEST_API_ACCESS_TOKEN}} # testing!
ZENODO_TEST_API_ACCESS_TOKEN: ${{secrets.ZENODO_TEST_API_ACCESS_TOKEN}}
TEST_PACKAGE_ID: ${{vars.TEST_PACKAGE_ID}}
TEST_PACKAGE_URL: ${{vars.TEST_PACKAGE_URL}}
jobs:
initial-cleanup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip" # caching pip dependencies
- run: pip install .
- run: backoffice wipe --bucket "${{vars.S3_TEST_BUCKET}}" --prefix "${{vars.S3_TEST_FOLDER}}"
test-stage-wf:
needs: initial-cleanup
uses: ./.github/workflows/stage_call.yaml
with:
resource_id: ${{vars.TEST_PACKAGE_ID}} # testing!
package_url: ${{vars.TEST_PACKAGE_URL}} # testing!
S3_HOST: ${{vars.S3_HOST}}
S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing!
S3_FOLDER: ${{vars.S3_TEST_FOLDER}}/ci # testing!
secrets: inherit
test-publish-wf:
needs: test-stage-wf
uses: ./.github/workflows/publish_call.yaml
with:
resource_id: ${{vars.TEST_PACKAGE_ID}} # testing!
stage_number: 1
S3_HOST: ${{vars.S3_HOST}}
S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing!
S3_FOLDER: ${{vars.S3_TEST_FOLDER}}/ci # testing!
ZENODO_URL: ${{vars.ZENODO_TEST_URL}} # testing!
secrets: inherit
test-backup-wf:
needs: test-publish-wf
uses: ./.github/workflows/backup_call.yaml
with:
S3_HOST: ${{vars.S3_HOST}}
S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing!
S3_FOLDER: ${{vars.S3_TEST_FOLDER}}/ci # testing!
ZENODO_URL: ${{vars.ZENODO_TEST_URL}} # testing!
secrets: inherit
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip" # caching pip dependencies
- run: pip install .[dev]
- run: black . --check
- run: pyright -p pyproject.toml
- run: pytest
- name: export documentation
run: pdoc backoffice -o ./docs
- uses: actions/upload-pages-artifact@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
path: docs/
deploy_docs:
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4