Skip to content

Commit

Permalink
Better Workflow File
Browse files Browse the repository at this point in the history
  • Loading branch information
0xIchigo committed Jun 21, 2024
1 parent 2590773 commit e6ce34c
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:

jobs:
build:

runs-on: ubuntu-latest

permissions:
Expand All @@ -28,18 +27,24 @@ jobs:
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Cache target directory
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
path: target
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-
- name: Set up Rust
uses: actions-rs/toolchain@v1
Expand All @@ -48,36 +53,35 @@ jobs:
profile: minimal
override: true
components: clippy

- name: Install Protobuf Compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Clean up disk space
run: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: Check formatting
run: cargo fmt --all -- --check

- name: rust-clippy-check
uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: cargo build --verbose

- name: Save build artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: target

- name: Run tests
run: cargo test --verbose

0 comments on commit e6ce34c

Please sign in to comment.