-
Notifications
You must be signed in to change notification settings - Fork 76
133 lines (109 loc) · 3.76 KB
/
main.yml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# see https://github.com/karlicoss/pymplate for up-to-date reference
name: CI
on:
push:
branches: '*'
tags: 'v[0-9]+.*' # only trigger on 'release' tags for PyPi
# TODO not sure if need 'pull_request'??
workflow_dispatch: # needed to trigger workflows manually
env:
# useful for scripts & sometimes tests to know
CI: true
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest] # todo windows-latest?
python-version: [3.6, 3.7, 3.8]
runs-on: ${{ matrix.platform }}
steps:
# ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
with:
submodules: recursive
# uncomment for SSH debugging
# - uses: mxschmitt/action-tmate@v3
# need bash, otherwise isn't running under Windows? seems to be a powershell thing?
- run: bash scripts/ci/run
- uses: actions/upload-artifact@v2
with:
name: .coverage.mypy-core_${{ matrix.platform }}_${{ matrix.python-version }}
path: .coverage.mypy-core/
- uses: actions/upload-artifact@v2
with:
name: .coverage.mypy-misc_${{ matrix.platform }}_${{ matrix.python-version }}
path: .coverage.mypy-misc/
end2end_tests:
needs: [build] # just so it doesn't uses less resources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: |
docker build -f .ci/end2end_tests.Dockerfile . -t promnesia_end2end_tests
docker run -e CI promnesia_end2end_tests
install_and_run_test:
# TODO use setup-python thing?
# TODO FIXME run on macos too?
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: ci/github-ci-compat
- run: |
python3 -m pip install .
export PATH=ci/fake-systemd:$PATH
tests/install_and_run
pypi:
runs-on: ubuntu-latest
needs: [build, end2end_tests, install_and_run_test]
steps:
# ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: actions/checkout@v2
with:
submodules: recursive
- name: 'release to test pypi'
# always deploy merged master to test pypi
if: github.event.ref == 'refs/heads/master'
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: pip3 install --user wheel twine && scripts/release --test
# TODO run pip install just to test?
- name: 'release to pypi'
# always deploy tags to release pypi
# NOTE: release tags are guarded by on: push: tags on the top
if: startsWith(github.event.ref, 'refs/tags')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: pip3 install --user wheel twine && scripts/release
###
build_extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v1
with:
node-version: '14'
- run: scripts/ci/extension --release --lint
# TODO ugh. can't share github actions artifacts publicly...
# TODO for fuck's sake... why does it end up named as .zip.zip ????
- uses: actions/upload-artifact@v2
with:
name: 'promnesia-chrome-latest.zip'
path: 'extension/dist/chrome/web-ext-artifacts/*.zip'
- uses: actions/upload-artifact@v2
with:
name: 'promnesia-firefox-latest.zip'
path: 'extension/dist/firefox/web-ext-artifacts/*.zip'