-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for PR validation with build and test jobs
- Loading branch information
Matej Almasi
committed
Dec 8, 2024
1 parent
929547d
commit 5af3be7
Showing
2 changed files
with
57 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: PR Validation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ${{ matrix.platform.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
platform: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
command: cargo | ||
|
||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
command: cross | ||
|
||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
command: cargo | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Cargo and cross | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
~/.cargo/bin | ||
key: ${{ matrix.platform.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ matrix.platform.target }}-cargo | ||
|
||
- name: Install cross | ||
if: matrix.platform.command == 'cross' | ||
run: | | ||
if ! command -v cross &>/dev/null; then | ||
cargo install cross | ||
fi | ||
- name: Build | ||
run: ${{ matrix.platform.command }} build --target ${{ matrix.platform.target }} | ||
|
||
- name: Test | ||
run: ${{ matrix.platform.command }} test --target ${{ matrix.platform.target }} |
This file was deleted.
Oops, something went wrong.