Skip to content

Commit 1c64ca7

Browse files
authored
test: Upgrade GitHub Actions (#2701)
* test: Upgrade GitHub Actions * node: 18x --> 18.x
1 parent ea8520e commit 1c64ca7

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/tests.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
1-
# TODO: Line 43, enable pytest --doctest-modules
1+
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
2+
# TODO: Line 48, enable pytest --doctest-modules
23

34
name: Tests
4-
on: [push, pull_request]
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
510
jobs:
611
Tests:
712
strategy:
813
fail-fast: false
914
max-parallel: 15
1015
matrix:
11-
node: [12.x, 14.x, 16.x]
16+
node: [14.x, 16.x, 18.x]
1217
python: ["3.6", "3.8", "3.10"]
1318
os: [macos-latest, ubuntu-latest, windows-latest]
1419
runs-on: ${{ matrix.os }}
1520
steps:
1621
- name: Checkout Repository
17-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
1823
- name: Use Node.js ${{ matrix.node }}
1924
uses: actions/setup-node@v3
2025
with:
2126
node-version: ${{ matrix.node }}
2227
- name: Use Python ${{ matrix.python }}
23-
uses: actions/setup-python@v3
28+
uses: actions/setup-python@v4
2429
with:
2530
python-version: ${{ matrix.python }}
2631
env:
27-
PYTHON_VERSION: ${{ matrix.python }}
32+
PYTHON_VERSION: ${{ matrix.python }} # Why do this?
2833
- name: Install Dependencies
2934
run: |
3035
npm install --no-progress
3136
pip install flake8 pytest
3237
- name: Set Windows environment
33-
if: matrix.os == 'windows-latest'
38+
if: startsWith(matrix.os, 'windows')
3439
run: |
3540
echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
3641
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
3742
- name: Lint Python
38-
if: matrix.os == 'ubuntu-latest'
43+
if: startsWith(matrix.os, 'ubuntu')
3944
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
4045
- name: Run Python tests
4146
run: python -m pytest
4247
# - name: Run doctests with pytest
4348
# run: python -m pytest --doctest-modules
49+
- name: Environment Information
50+
run: npx envinfo
4451
- name: Run Node tests
4552
run: npm test

0 commit comments

Comments
 (0)