ci: make various improvements

- Use the action Swatinem/rust-cache@v2 as it caches previously used
  dependencies, which helps save a lot of time.
- remove secrets.GITHUB_TOKEN as it's available by default.
- Use Github Actions concurrency feature, which will cancel previous
  jobs from a PR if it's been updated.
This commit is contained in:
dundargoc 2023-09-19 09:22:26 +02:00 committed by dundargoc
parent 302ceea81d
commit 0dcfda7333
6 changed files with 19 additions and 11 deletions

View file

@ -12,6 +12,11 @@ on:
paths:
- 'deb.asc'
- '.github/workflows/apt.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
apt_installation:
runs-on: ubuntu-latest

View file

@ -6,6 +6,10 @@ on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
build:
name: Conventional Commits
@ -14,6 +18,3 @@ jobs:
- uses: actions/checkout@v4
- uses: webiny/action-conventional-commits@v1.1.0
# optional, required for private repos
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -3,6 +3,10 @@ on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
build:
name: Build Nix targets

View file

@ -20,5 +20,3 @@ jobs:
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

View file

@ -20,8 +20,6 @@ jobs:
steps:
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-pr-stale: 30
days-before-pr-close: 14
stale-pr-message: 'This pull request is stale because it has been open for 30 days with no activity.'

View file

@ -16,6 +16,10 @@ on:
- 'Cargo.*'
- build.rs
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
@ -34,10 +38,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- run: rustup toolchain install ${{ matrix.rust }} --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Install cargo-hack
uses: nick-fields/retry@v2