-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (93 loc) · 2.93 KB
/
Copy pathbuild_test_deploy.yml
File metadata and controls
101 lines (93 loc) · 2.93 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
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
name: build_test_deploy
on:
push:
branches-ignore:
- gh-pages
release:
types: [published]
jobs:
test-base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.7"
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry install
- run: poetry run task test
test-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.7"
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry install --only main
- run: poetry run python -c "import check_shapes"
test-versions:
runs-on: ubuntu-latest
strategy:
matrix:
framework: ["py", "np", "tf", "tfp", "jax", "torch"]
version: ["min", "max"]
include:
- version: "min"
python: "3.7"
- version: "max"
python: "3.11"
name: test-${{ matrix.framework }}-${{ matrix.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- run: pip install -r poetryenv_requirements.txt
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: ./poetryenv poetryenvs/${{ matrix.framework }}_${{ matrix.version }} install
- run: ./poetryenv poetryenvs/${{ matrix.framework }}_${{ matrix.version }} run task test
all-tests:
needs: [test-base, test-install, test-versions]
runs-on: ubuntu-latest
steps:
- run: echo ok
docs:
needs: all-tests
if: contains(fromJson('["refs/heads/main", "refs/heads/develop"]'), github.ref)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
ref: gh-pages
path: gh-pages
- uses: actions/setup-python@v4
with:
python-version: "3.7"
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry install
- run: poetry run task docs
- name: Commit new documentation
run: |
branch=$(git symbolic-ref --short HEAD)
rm -rf gh-pages/docs/${branch}
mv docs_build gh-pages/docs/${branch}
cd gh-pages
git add docs
git config --global user.email "none"
git config --global user.name "github-actions-bot"
git commit -m "Build documentation."
git push
deploy:
needs: all-tests
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.7"
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry build
- run: poetry publish -u __token__ -p ${{ secrets.CHECK_SHAPES_PYPI_TOKEN }}