Skip to content

Commit

Permalink
feat: update self-hosted runner (#14)
Browse files Browse the repository at this point in the history
* feat: update self-hosted runner

* feat: self-hosted runner

* fix: upload-sarif v3

* feat: self-host runner

* fix: self host runner

* fix: test flow

* fix: remove protoc

---------

Co-authored-by: Harry Nguyen <[email protected]>
  • Loading branch information
0x5ea000000 and zk-steve authored May 13, 2024
1 parent 6d72a20 commit 1c2ab28
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ on:
jobs:
cargo-check:
name: Cargo check
runs-on: ubuntu-latest
runs-on:
group: Default
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: arduino/setup-protoc@v3
- uses: actions-rs/cargo@v1
with:
command: check

fmt-check:
name: Rust fmt
runs-on: ubuntu-latest
runs-on:
group: Default
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
Expand All @@ -42,15 +43,21 @@ jobs:

test-and-coverage:
name: Test and Coverage
runs-on: ubuntu-latest
runs-on:
group: Default
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: arduino/setup-protoc@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install dependencies
run: |
apt install libssl-dev
rustup self update
rustup update
cargo install cargo-tarpaulin
Expand All @@ -62,7 +69,8 @@ jobs:
name: Release Packaging
env:
PROJECT_NAME_UNDERSCORE: rust-server
runs-on: ubuntu-latest
runs-on:
group: Default
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [cargo-check, fmt-check, test-and-coverage]
steps:
Expand All @@ -85,13 +93,11 @@ jobs:
toolchain: stable
override: true

- uses: arduino/setup-protoc@v3

- name: Release Build
run: cargo build --release --all

- name: "Upload Artifact"
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME_UNDERSCORE }}
path: target/release/cli
path: target/release/cli
20 changes: 4 additions & 16 deletions .github/workflows/rust-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,17 @@ on:
- cron: '27 4 * * 6'

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install protoc and grpcio-tools
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
cargo install grpcio-compiler
rust-clippy-analyze:
name: Run Rust Clippy Analyzer
runs-on: ubuntu-latest
needs: setup
runs-on:
group: Default
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
Expand All @@ -62,7 +50,7 @@ jobs:
continue-on-error: true

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

0 comments on commit 1c2ab28

Please sign in to comment.