diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index b8a6c6ac..263645b6 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -1,21 +1,22 @@ name: Python black -# Run either when pushing directly to main/master or in a PR targeting main/master on: push: branches: - master - main paths: - - "**.py" - ".github/workflows/black.yml" + - "**.py" pull_request: - branches: - - master - - main paths: - - "**.py" - ".github/workflows/black.yml" + - "**.py" + +# Cancel previous runs for PRs but not pushes to main +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true # https://github.com/psf/black jobs: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index addc8584..367ff95c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,6 +1,5 @@ -name: Go build +name: Go -# Run either when pushing directly to main/master or in a PR targeting main/master on: push: branches: @@ -16,18 +15,26 @@ on: - master - main +# Cancel previous runs for PRs but not pushes to main +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest defaults: run: working-directory: ./go + steps: - - uses: actions/checkout@v4 + - name: Check out repository + uses: actions/checkout@v4 + - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.22.x" cache-dependency-path: go/go.sum - name: Install dependencies @@ -36,5 +43,5 @@ jobs: - name: Build run: go build -v ./... - - name: Test with the Go CLI + - name: Run tests run: go test diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index cce663a3..56e1fbeb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,20 +1,21 @@ name: Integration Tests -# Run either when pushing directly to main/master or in a PR targeting main/master on: push: branches: - master - main pull_request: - branches: - - master - - main permissions: id-token: write contents: read +# Cancel previous runs for PRs but not pushes to main +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml index 401456d9..6693ba25 100644 --- a/.github/workflows/isort.yml +++ b/.github/workflows/isort.yml @@ -1,28 +1,28 @@ name: Python isort -# Run either when pushing directly to main/master or in a PR targeting main/master on: push: branches: - master - main paths: - - "**.py" - ".github/workflows/isort.yml" + - "**.py" pull_request: - branches: - - master - - main paths: - - "**.py" - ".github/workflows/isort.yml" + - "**.py" + +# Cancel previous runs for PRs but not pushes to main +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true -# https://github.com/marketplace/actions/python-isort jobs: format: runs-on: ubuntu-latest steps: - - name: Check out source repository + - name: Check out repository uses: actions/checkout@v4 - name: Set up Python environment diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 72bc0b34..d7aaed74 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -1,23 +1,24 @@ name: Python pip -# Run either when pushing directly to main/master or in a PR targeting main/master on: push: branches: - master - main paths: - - "python/requirements.txt" - ".github/workflows/pip.yml" + - "python/requirements.txt" pull_request: - branches: - - master - - main paths: - - "python/requirements.txt" - ".github/workflows/pip.yml" + - "python/requirements.txt" + +# Cancel previous runs for PRs but not pushes to main +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + -# https://github.com/py-actions/py-dependency-install jobs: dependencies: runs-on: ubuntu-latest diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 309f20af..05ce4ec5 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -7,22 +7,24 @@ on: - master - main paths: - - "**.py" - ".github/workflows/ruff.yml" + - "**.py" pull_request: - branches: - - master - - main paths: - - "**.py" - ".github/workflows/ruff.yml" + - "**.py" + +# Cancel previous runs for PRs but not pushes to main +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true # https://github.com/chartboost/ruff-action jobs: lint: runs-on: ubuntu-latest steps: - - name: Check out source repository + - name: Check out repository uses: actions/checkout@v4 - name: Set up Python environment diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index db30c50e..d7365601 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -28,8 +28,12 @@ env: jobs: build: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./rust + steps: - - name: Check out source repository + - name: Check out repository uses: actions/checkout@v4 - name: Set up Rust toolchain @@ -55,17 +59,19 @@ jobs: restore-keys: ${{ runner.os }}-cargo- - name: Build - working-directory: rust run: cargo build - name: Run tests - working-directory: rust run: cargo test --no-fail-fast lint: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./rust + steps: - - name: Check out source repository + - name: Check out repository uses: actions/checkout@v4 - name: Set up Rust toolchain @@ -88,9 +94,7 @@ jobs: restore-keys: ${{ runner.os }}-cargo- - name: Check formatting - working-directory: rust run: cargo fmt --check --verbose - name: Lint - working-directory: rust run: cargo clippy -- -Dwarnings