|
1 | | ---- |
2 | | -name: CI |
| 1 | +name: Build and Test |
3 | 2 |
|
4 | 3 | on: |
5 | 4 | push: |
|
8 | 7 | branches: [master, main] |
9 | 8 |
|
10 | 9 | jobs: |
11 | | - deprecated-tests-py27: |
12 | | - name: Tests on 2.7.18 |
13 | | - runs-on: ubuntu-20.04 |
14 | | - container: |
15 | | - image: python:2.7.18-buster |
16 | | - steps: |
17 | | - - uses: actions/checkout@v3 |
18 | | - - name: Install dependencies |
19 | | - run: | |
20 | | - python -m pip install --upgrade pip setuptools wheel poetry |
21 | | - poetry config experimental.new-installer false ||: |
22 | | - poetry install |
23 | | - - name: Do lint |
24 | | - run: | |
25 | | - poetry run flake8 --max-line-length 120 --ignore=E721 . |
26 | | - - name: Do tests |
27 | | - run: | |
28 | | - poetry run pytest --cov uchecker -v |
29 | | - tests: |
30 | | - name: Tests on ${{ matrix.python-version }} |
31 | | - runs-on: ubuntu-20.04 |
32 | | - |
| 10 | + build-and-test: |
| 11 | + name: Test on Python ${{ matrix.python-version }} |
| 12 | + runs-on: ubuntu-latest |
33 | 13 | strategy: |
| 14 | + fail-fast: false |
34 | 15 | matrix: |
35 | | - python-version: ["3.5.10", "3.6.15", "3.7.16", "3.8.16", "3.9.16", "3.10.11", "3.11.6"] |
| 16 | + python-version: ["3.9", "3.10", "3.11", "3.12"] |
36 | 17 |
|
37 | 18 | steps: |
38 | | - - uses: actions/checkout@v3 |
39 | | - - uses: actions/setup-python@v4 |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Set up Python ${{ matrix.python-version }} and cache dependencies |
| 23 | + uses: actions/setup-python@v5 |
40 | 24 | with: |
41 | 25 | python-version: ${{ matrix.python-version }} |
42 | | - - name: Install dependencies |
43 | | - run: | |
44 | | - python -m pip install --upgrade pip setuptools wheel poetry |
45 | | - poetry config experimental.new-installer false ||: |
46 | | - poetry install |
47 | | - - name: Do lint |
48 | | - run: | |
49 | | - poetry run flake8 --max-line-length 120 --ignore=E721 . |
50 | | - - name: Do tests |
51 | | - run: | |
52 | | - poetry run pytest --cov uchecker -v |
| 26 | + cache: 'pip' |
| 27 | + cache-dependency-path: requirements-dev.txt |
| 28 | + |
| 29 | + - name: Upgrade pip |
| 30 | + run: python -m pip install --upgrade pip |
| 31 | + |
| 32 | + - name: Install dependencies from locked file |
| 33 | + run: python -m pip install -r requirements-dev.txt |
| 34 | + |
| 35 | + - name: Install flake8 |
| 36 | + run: python -m pip install flake8 |
| 37 | + |
| 38 | + - name: Install |
| 39 | + run: pip install -e . |
| 40 | + |
| 41 | + - name: Run linter |
| 42 | + run: flake8 --max-line-length 120 --ignore=E721 . |
53 | 43 |
|
| 44 | + - name: Run tests |
| 45 | + run: pytest --cov uchecker -v |
0 commit comments