Skip to content

Commit

Permalink
Add github action for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sighol committed Aug 26, 2024
1 parent e49f343 commit 8bdbf6c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/rust-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Rust CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [stable]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || '' }}

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

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

0 comments on commit 8bdbf6c

Please sign in to comment.