Adding concurrency key to cancel previously running commit pipelines within the same PR #739
Workflow file for this run
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: | |
workflow_dispatch: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dnb') }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] | |
python: ["3.10.11"] | |
node-version: [16.x] | |
fail-fast: false | |
name: Build on ${{ matrix.os }} with Python ${{ matrix.python }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Install libomp | |
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-13' }} | |
run: brew install libomp | |
- name: Install uv | |
run: pip install uv | |
- name: Create venv and install Python dependencies from uv.lock | |
run: uv sync | |
lint: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] | |
python: ["3.10.11"] | |
fail-fast: false | |
name: Lint on ${{ matrix.os }} with Python ${{ matrix.python }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Run ruff | |
run: uv run ruff format --check . | |
test: | |
needs: lint | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] | |
python: ["3.10.11"] | |
fail-fast: false | |
name: Test on ${{ matrix.os }} with Python ${{ matrix.python }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Run notebooks | |
run: uv run python tests/execute_notebooks.py |