Merge pull request #19 from gasbytes/ci-cd #2
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: Ubuntu Build and Test | |
on: | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
ubuntu-build: | |
name: Build and Test (Ubuntu) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Build Prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential autoconf libtool | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Cache Rust dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ubuntu-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
ubuntu-cargo- | |
- name: Build and Test wolfcrypt-rs | |
run: | | |
cd wolfcrypt-rs | |
make build | |
make test | |
- name: Build and Test rustls-wolfcrypt-provider | |
run: | | |
cd rustls-wolfcrypt-provider | |
make build | |
make test | |
- name: Check formatting | |
run: | | |
cd wolfcrypt-rs | |
cargo fmt --all -- --check | |
cd ../rustls-wolfcrypt-provider | |
cargo fmt --all -- --check | |
- name: Run clippy | |
run: | | |
cd wolfcrypt-rs | |
cargo clippy -- -D warnings | |
cd ../rustls-wolfcrypt-provider | |
cargo clippy -- -D warnings |