Skip to content

Commit

Permalink
ci: Standardise CI across repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
VorpalBlade committed Mar 16, 2024
1 parent 7191b6f commit 6c5d63f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/ci.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous integration
name: Build

permissions:
contents: read
Expand All @@ -9,8 +9,13 @@ on:
pull_request:
branches: [ "main" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
Expand All @@ -28,6 +33,7 @@ jobs:
- armv7-unknown-linux-gnueabihf
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
# Disable until cross is fixed
#- x86_64-pc-windows-gnu
rust:
- stable
Expand All @@ -48,7 +54,7 @@ jobs:
- name: Cross test
run: cross test --target ${{ matrix.target }} --verbose

exotic-platforms:
exotic-os:
name: Test - ${{ matrix.target }} on ${{ matrix.os }} (stable rust)
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -90,11 +96,3 @@ jobs:
- name: Test
run: cargo test --verbose

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup install --profile minimal stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
18 changes: 16 additions & 2 deletions .github/workflows/rust-clippy.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rust-clippy analyze
name: Lint

on:
push:
Expand All @@ -9,6 +9,10 @@ on:
schedule:
- cron: '41 20 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
rust-clippy-analyze:
name: Run rust-clippy analyzing
Expand Down Expand Up @@ -39,11 +43,21 @@ jobs:
cargo clippy
--all-features
--all-targets
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
--message-format=json -- -D warnings | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup install --profile minimal stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check

4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
tags:
- v[0-9]+.*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
create-release:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 6c5d63f

Please sign in to comment.