Skip to content

Commit

Permalink
Update GitHub workflow
Browse files Browse the repository at this point in the history
* Run workflow on pull request as well as push
* Run workflow on matrix of 3 different OS
* Use actions/cache to speed up the build
  • Loading branch information
yestyle committed Nov 9, 2023
1 parent 9d88128 commit 261862d
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,59 @@ name: CI

on:
push:
branches:
- main
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

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

- name: Setup prerequisites
shell: bash
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install lzop
- name: Setup prerequisites
shell: bash
if: matrix.os == 'macOS-latest'
run: |
brew install lzop
- name : Toolchain info
run: |
cargo --version --verbose
rustc --version --verbose
- name: Run cargo build
run: |
cargo build --release
- name: Run cargo clippy
run: |
cargo clippy
env:
CI: true

- name: Run cargo test
run: |
cargo test --release --test integration -- --show-output
Expand Down

0 comments on commit 261862d

Please sign in to comment.