|
11 | 11 | - '**'
|
12 | 12 |
|
13 | 13 | 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 |
| - |
41 | 14 | tests:
|
42 |
| - runs-on: ubuntu-latest |
| 15 | + name: ${{ matrix.os }} / ${{ matrix.python-version }} |
| 16 | + runs-on: ${{ matrix.os }}-latest |
43 | 17 | strategy:
|
44 | 18 | max-parallel: 4
|
45 | 19 | 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 | + |
47 | 27 | steps:
|
48 |
| - - uses: actions/checkout@v2 |
| 28 | + - uses: actions/checkout@v3 |
49 | 29 |
|
50 | 30 | - name: Set up Python ${{ matrix.python-version }}
|
51 |
| - uses: actions/setup-python@v1 |
| 31 | + uses: actions/setup-python@v3 |
52 | 32 | with:
|
53 | 33 | python-version: ${{ matrix.python-version }}
|
54 | 34 |
|
55 | 35 | - name: Get full Python version
|
56 | 36 | 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))") |
59 | 39 |
|
60 | 40 | - name: Install poetry
|
61 |
| - shell: bash |
62 | 41 | 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 |
66 | 51 |
|
67 | 52 | - name: Configure poetry
|
68 |
| - shell: bash |
69 |
| - run: poetry config virtualenvs.in-project true |
| 53 | + run: | |
| 54 | + poetry config virtualenvs.in-project true |
70 | 55 |
|
71 | 56 | - name: Set up cache
|
72 |
| - uses: actions/cache@v2 |
| 57 | + uses: actions/cache@v3 |
73 | 58 | id: cache
|
74 | 59 | with:
|
75 | 60 | path: .venv
|
76 | 61 | key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
|
77 | 62 |
|
78 | 63 | - name: Ensure cache is healthy
|
79 | 64 | 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 |
82 | 66 |
|
83 | 67 | - name: Install dependencies
|
84 | 68 | shell: bash
|
|
0 commit comments