Skip to content

Commit

Permalink
Merge pull request #93 from Thaumy/ci
Browse files Browse the repository at this point in the history
Refactor CI
  • Loading branch information
saying121 authored Dec 11, 2024
2 parents 755e04e + de831d8 commit f1440f6
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 223 deletions.
1 change: 0 additions & 1 deletion .github/actions/show-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ runs:
shell: bash
run: |
cargo -V
cargo fmt -- -V
rustc -V
uname -a
22 changes: 15 additions & 7 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
name: Audit

on:
push:
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- 'Cargo.lock'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
audit:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]

steps:
- name: Checkout
Expand All @@ -21,12 +29,12 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: 1.81.0

- name: Show environment information
- name: Show env
uses: ./.github/actions/show-env

- name: Run cargo-audit
- name: Audit
uses: ./.github/actions/audit
84 changes: 0 additions & 84 deletions .github/workflows/build-dev.yml

This file was deleted.

85 changes: 0 additions & 85 deletions .github/workflows/build-release.yml

This file was deleted.

31 changes: 17 additions & 14 deletions .github/workflows/build-check.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
name: Check if Psh can build
name: Build

on:
push:
pull_request:
types:
- opened
- reopened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUST_BACKTRACE: 1

jobs:
build:
name: Build Check
runs-on: ${{ matrix.os }}

strategy:
matrix:
# we only need to support linux
os: [ubuntu-20.04, ubuntu-latest]
os: [ubuntu-22.04]
# TODO: do we want to support musl?
target: [x86_64-unknown-linux-gnu]
# make sure it runs on latest stable rust
toolchain: [stable]

env:
SCCACHE_GHA_ENABLED: "true"
Expand All @@ -27,22 +31,21 @@ jobs:
steps:
- uses: actions/checkout/@v4

- name: Install Toolchain
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
toolchain: 1.81.0

- name: Show environment information
- name: Show env
uses: ./.github/actions/show-env

- name: Install Protoc
- name: Setup protoc
uses: arduino/setup-protoc@v3

- name: Run sccache-cache
- name: Setup build cache
uses: mozilla-actions/[email protected]

- name: Build Psh
- name: Build
uses: ./.github/actions/build
with:
target: ${{ matrix.target }}
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: Clippy

on:
push:
pull_request:
types:
- opened
- reopened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUST_BACKTRACE: 1

jobs:
clippy:
name: Clippy rust
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
# make sure it runs on latest stable rust
toolchain: [stable]
os: [ubuntu-22.04]

env:
SCCACHE_GHA_ENABLED: "true"
Expand All @@ -24,20 +29,20 @@ jobs:
steps:
- uses: actions/checkout/@v4

- name: Install Toolchain
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
toolchain: 1.81.0
components: clippy

- name: Show environment information
- name: Show env
uses: ./.github/actions/show-env

- name: Install Protoc
- name: Setup protoc
uses: arduino/setup-protoc@v3

- name: Run sccache-cache
- name: Setup build cache
uses: mozilla-actions/[email protected]

- name: Run clippy
- name: Clippy
uses: ./.github/actions/clippy
19 changes: 13 additions & 6 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Rustfmt

on:
push:
pull_request:
types:
- opened
- reopened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
rustfmt:
Expand All @@ -11,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]

steps:
- name: Checkout
Expand All @@ -20,13 +27,13 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: 1.81.0
components: rustfmt

- name: Show environment information
- name: Show env
uses: ./.github/actions/show-env

- name: Check fmt
- name: Rustfmt
uses: ./.github/actions/rustfmt
Loading

0 comments on commit f1440f6

Please sign in to comment.