Skip to content

Commit

Permalink
Update CI (#33)
Browse files Browse the repository at this point in the history
Switch to Merge Queue
Remove bors
  • Loading branch information
urschrei authored Dec 26, 2023
1 parent c2183a0 commit a1ecfc7
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 20 deletions.
72 changes: 55 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,61 @@
on: [pull_request, push]
name: Run tests

on:
push:
branches:
- master
- main
- staging
- trying
- release/**
pull_request:
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
ci-result:
name: ci result
robust:
name: robust
runs-on: ubuntu-latest
needs:
- build_and_test
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Mark the job as a success
if: success()
run: exit 0
- name: Mark the job as a failure
if: "!success()"
run: exit 1
- name: Checkout repository
uses: actions/checkout@v4
- run: cargo install cargo-all-features
- run: cargo build-all-features --verbose --examples
- run: cargo test-all-features

build_and_test:
name: Test all features
check:
name: robust Rustfmt and Clippy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cargo install cargo-all-features
- run: cargo build-all-features --verbose --examples
- run: cargo test-all-features --verbose
- name: Checkout repository
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Check formatting using Rustfmt
run: cargo fmt --check
- name: Lint using Clippy
run: cargo clippy --tests

all_checks_complete:
needs:
- robust
- check
if: always()
runs-on: ubuntu-latest
steps:
- name: Result
run: |
jq -C <<< "${needs}"
# Check if all needs were successful or skipped.
"$(jq -r 'all(.result as $result | (["success", "skipped"] | contains([$result])))' <<< "${needs}")"
env:
needs: ${{ toJson(needs) }}
3 changes: 0 additions & 3 deletions bors.toml

This file was deleted.

0 comments on commit a1ecfc7

Please sign in to comment.