Skip to content

Commit 6c2b5b6

Browse files
committed
switch from travis to GHA
1 parent e94b5d7 commit 6c2b5b6

File tree

2 files changed

+79
-14
lines changed

2 files changed

+79
-14
lines changed

.github/workflows/tox.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Tox CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.8"
20+
21+
- name: Install tox
22+
run: pip install --user tox
23+
24+
- name: Lint
25+
run: tox -e lint
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
python-version: ["3.8", "3.9", "3.10", "3.11"]
32+
steps:
33+
- name: Checkout repo
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Install tox
42+
run: pip install --user tox
43+
44+
- name: Select tox env
45+
id: tox-env
46+
run: echo tox-env=py${{ matrix.python-version }} | tr -d '.' >> ${GITHUB_OUTPUT}
47+
48+
- name: Test
49+
run: tox -e ${{ steps.tox-env.outputs.tox-env }}
50+
51+
set_merge_ok:
52+
name: Set Merge OK
53+
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
54+
needs:
55+
- lint
56+
- test
57+
outputs:
58+
merge_ok: ${{ steps.set_merge_ok.outputs.merge_ok }}
59+
runs-on: ubuntu-latest
60+
steps:
61+
- id: set_merge_ok
62+
run: echo 'merge_ok=true' >> ${GITHUB_OUTPUT}
63+
64+
merge_ok:
65+
name: Merge OK
66+
if: always()
67+
needs:
68+
- set_merge_ok
69+
runs-on: ubuntu-latest
70+
steps:
71+
- run: |
72+
merge_ok="${{ needs.set_merge_ok.outputs.merge_ok }}"
73+
if [[ "${merge_ok}" == "true" ]]; then
74+
echo "Merge OK"
75+
exit 0
76+
else
77+
echo "Merge NOT OK"
78+
exit 1
79+
fi

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)