Updating core.yml #5
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
name: core | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- "**/README.md" | |
- "**/LICENSE" | |
- "**/CONTRIBUTING.md" | |
- "**/.gitignore" | |
- "**/.github/ISSUE_TEMPLATE/**" | |
- "**/.config/**" | |
jobs: | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Cache Cargo Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Protobuf | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Run Clippy | |
run: cargo clippy --all-targets | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: clippy | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- name: Cache Cargo Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Protobuf | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Build Project | |
run: cargo build --release | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- name: Cache Cargo Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Protobuf | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Run Tests | |
run: cargo test | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- name: Install Protobuf | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Install Tarpaulin | |
run: cargo install cargo-tarpaulin | |
- name: Run Coverage | |
run: cargo tarpaulin --out Html | |
- name: Upload Coverage Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: ./tarpaulin-report.html |