Skip to content

Commit 10e2740

Browse files
committed
Update CI workflow
1 parent dbc3555 commit 10e2740

File tree

1 file changed

+26
-42
lines changed

1 file changed

+26
-42
lines changed

.github/workflows/main.yml

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,74 +11,58 @@ on:
1111
- '**'
1212

1313
jobs:
14-
flake8:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Setup Python
18-
uses: actions/setup-python@v1
19-
with:
20-
python-version: 3.7
21-
architecture: x64
22-
- uses: actions/checkout@master
23-
- name: Install flake8
24-
run: pip install flake8
25-
- name: Run flake8
26-
uses: suo/flake8-github-action@releases/v1
27-
with:
28-
checkName: 'flake8'
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
32-
black:
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v1
36-
- name: Run Black
37-
uses: lgeiger/black-action@master
38-
with:
39-
args: --check crashtest/ tests/
40-
4114
tests:
42-
runs-on: ubuntu-latest
15+
name: ${{ matrix.os }} / ${{ matrix.python-version }}
16+
runs-on: ${{ matrix.os }}-latest
4317
strategy:
4418
max-parallel: 4
4519
matrix:
46-
python-version: [3.6, 3.7, 3.8]
20+
os: [Ubuntu, MacOS, Windows]
21+
python-version: [3.7, 3.8, 3.9, "3.10"]
22+
23+
defaults:
24+
run:
25+
shell: bash
26+
4727
steps:
48-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
4929

5030
- name: Set up Python ${{ matrix.python-version }}
51-
uses: actions/setup-python@v1
31+
uses: actions/setup-python@v3
5232
with:
5333
python-version: ${{ matrix.python-version }}
5434

5535
- name: Get full Python version
5636
id: full-python-version
57-
shell: bash
58-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
37+
run: |
38+
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
5939
6040
- name: Install poetry
61-
shell: bash
6241
run: |
63-
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
64-
python get-poetry.py -y
65-
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
42+
curl -sL https://install.python-poetry.org | python - -y
43+
44+
- name: Update PATH
45+
if: ${{ matrix.os != 'Windows' }}
46+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
47+
48+
- name: Update PATH for Windows
49+
if: ${{ matrix.os == 'Windows' }}
50+
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
6651

6752
- name: Configure poetry
68-
shell: bash
69-
run: poetry config virtualenvs.in-project true
53+
run: |
54+
poetry config virtualenvs.in-project true
7055
7156
- name: Set up cache
72-
uses: actions/cache@v2
57+
uses: actions/cache@v3
7358
id: cache
7459
with:
7560
path: .venv
7661
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
7762

7863
- name: Ensure cache is healthy
7964
if: steps.cache.outputs.cache-hit == 'true'
80-
shell: bash
81-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
65+
run: imeout 10s poetry run pip --version || rm -rf .venv
8266

8367
- name: Install dependencies
8468
shell: bash

0 commit comments

Comments
 (0)