Update GitHub actions #124
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
- dev | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.1 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: 20.x | |
registry-url: https://registry.npmjs.org | |
- name: Set up Python | |
uses: actions/setup-python@v5.0.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Use npm cache | |
uses: actions/cache@v4.0.1 | |
with: | |
path: ~/.npm | |
key: npm | |
- name: Use pip cache | |
uses: actions/cache@v4.0.1 | |
with: | |
path: ~/.cache/pip | |
key: pip-${{ matrix.python-version }} | |
- name: Use tox cache | |
uses: actions/cache@v4.0.1 | |
with: | |
path: .tox | |
key: tox-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }} | |
- name: Install test requirements | |
run: | | |
make install-test-deps | |
sudo npm install -g prettier | |
- name: Run tests | |
run: make test | |
- name: Run codecov | |
uses: codecov/codecov-action@v4.1.0 |