Skip to content

Commit

Permalink
Improve GitHub Actions CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Jan 18, 2024
1 parent a383063 commit 355e88a
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: CI
on:
push:
branches-ignore: [master]
branches:
- auto-cargo
- try
- automation/bors/try
- "rust-**"
pull_request:
branches: ['*']
branches:
- "**"

defaults:
run:
Expand All @@ -12,6 +17,10 @@ defaults:
permissions:
contents: read

concurrency:
group: "${{ github.workflow }}-${{ (github.ref == 'refs/heads/try' && github.sha) || github.ref }}"
cancel-in-progress: true

jobs:
success:
permissions:
Expand Down Expand Up @@ -53,6 +62,7 @@ jobs:
# Check Code style quickly by running `rustfmt` over all code
rustfmt:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
Expand All @@ -62,6 +72,7 @@ jobs:
# Ensure there are no clippy warnings
clippy:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
Expand All @@ -78,13 +89,15 @@ jobs:
# Ensure Cargo.lock is up-to-date
lockfile:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo update -p cargo --locked

check-version-bump:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
Expand All @@ -108,6 +121,7 @@ jobs:
CARGO_PROFILE_TEST_DEBUG: 1
CARGO_INCREMENTAL: 0
CARGO_PUBLIC_NETWORK_TESTS: 1
if: "github.repository == 'rust-lang/cargo'"
strategy:
matrix:
include:
Expand Down Expand Up @@ -191,13 +205,15 @@ jobs:

resolver:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo test -p resolver-tests

test_gitoxide:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update stable && rustup default stable
Expand All @@ -210,6 +226,7 @@ jobs:

build_std:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- run: rustup update nightly && rustup default nightly
Expand All @@ -220,6 +237,7 @@ jobs:
CARGO_RUN_BUILD_STD_TESTS: 1
docs:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- run: rustup update nightly && rustup default nightly
Expand Down Expand Up @@ -247,6 +265,7 @@ jobs:
msrv:
runs-on: ubuntu-latest
if: "github.repository == 'rust-lang/cargo'"
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-hack
Expand Down

0 comments on commit 355e88a

Please sign in to comment.