-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from saying121/ci
Split the original workflow into multiple
- Loading branch information
Showing
16 changed files
with
824 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Audit | ||
description: Check the code with audit | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install cargo-audit | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-audit | ||
|
||
- name: Audit | ||
shell: bash | ||
run: | | ||
cargo audit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Clippy | ||
description: Check the code with clippy | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Clippy | ||
shell: bash | ||
run: cargo clippy --locked --all-targets -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Rustfmt | ||
description: Check the code with rustfmt | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Fmt | ||
shell: bash | ||
run: cargo fmt --check --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Show env | ||
description: Show action env | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Show environment information | ||
shell: bash | ||
run: | | ||
cargo -V | ||
cargo fmt -- -V | ||
rustc -V | ||
uname -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
name: Test | ||
description: Run tests | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Test dev | ||
shell: bash | ||
run: cargo test --verbose | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-nextest | ||
|
||
- name: Test release | ||
- name: Test | ||
shell: bash | ||
run: cargo test --verbose --release | ||
run: cargo nextest run --workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Audit | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
audit: | ||
name: ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Setup Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
|
||
- name: Show environment information | ||
uses: ./.github/actions/show-env | ||
|
||
- name: Run cargo-audit | ||
uses: ./.github/actions/audit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Check if Psh can build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
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] | ||
# 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" | ||
RUSTC_WRAPPER: "sccache" | ||
|
||
steps: | ||
- uses: actions/checkout/@v4 | ||
|
||
- name: Install Toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: clippy | ||
|
||
- name: Show environment information | ||
uses: ./.github/actions/show-env | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v3 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Build Psh | ||
uses: ./.github/actions/build | ||
with: | ||
target: ${{ matrix.target }} | ||
release: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,21 @@ jobs: | |
# make sure it runs on latest stable | ||
toolchain: [stable] | ||
|
||
env: | ||
SCCACHE_GHA_ENABLED: "true" | ||
RUSTC_WRAPPER: "sccache" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
submodules: true | ||
|
||
- name: Setup Rust toolchain | ||
uses: hecrj/setup-rust-action@v2 | ||
- name: Install Toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
rust-version: ${{ matrix.toolchain }} | ||
targets: ${{ matrix.target }} | ||
components: rustfmt, clippy | ||
toolchain: ${{ matrix.toolchain }} | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v3 | ||
|
@@ -50,14 +52,8 @@ jobs: | |
# shell: bash | ||
# run: sudo apt -y install musl-tools | ||
|
||
- name: Setup protobuf | ||
shell: bash | ||
run: sudo apt -y install protobuf-compiler | ||
|
||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
prefix-key: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.toolchain }} | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Generate version | ||
id: gen-version | ||
|
@@ -69,31 +65,20 @@ jobs: | |
with: | ||
version: ${{ steps.gen-version.outputs.VERSION }} | ||
|
||
- name: Run check | ||
uses: ./.github/actions/check | ||
|
||
#- name: Run test | ||
# uses: ./.github/actions/test | ||
|
||
- name: Run build | ||
- name: Build Psh | ||
uses: ./.github/actions/build | ||
with: | ||
target: ${{ matrix.target }} | ||
release: false | ||
|
||
# - name: Generate artifacts name | ||
# id: gen-name | ||
# shell: bash | ||
# run: echo 'NAME=psh-dev-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.toolchain }}' >> $GITHUB_OUTPUT | ||
|
||
#- name: Generate binary extension | ||
# id: gen-ext | ||
# if: runner.os == 'Windows' | ||
# shell: bash | ||
# run: echo 'EXT=.exe' >> $GITHUB_OUTPUT | ||
|
||
#- name: Upload artifacts | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: ${{ steps.gen-name.outputs.NAME }} | ||
#path: ./target/${{ matrix.target }}/debug/psh${{ steps.gen-ext.outputs.EXT }} | ||
#path: ./target/${{ matrix.target }}/debug/psh | ||
#if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Clippy | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
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] | ||
|
||
env: | ||
SCCACHE_GHA_ENABLED: "true" | ||
RUSTC_WRAPPER: "sccache" | ||
|
||
steps: | ||
- uses: actions/checkout/@v4 | ||
|
||
- name: Install Toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: clippy | ||
|
||
- name: Show environment information | ||
uses: ./.github/actions/show-env | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v3 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Run clippy | ||
uses: ./.github/actions/clippy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Rustfmt | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Setup Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
|
||
- name: Show environment information | ||
uses: ./.github/actions/show-env | ||
|
||
- name: Check fmt | ||
uses: ./.github/actions/rustfmt |
Oops, something went wrong.