-
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.
feat(cicd): build and test workflow (#1)
Adding a GitHub Actions workflow to build and test the Rust project from CI/CD - this will trigger on any change to a pull request or main branch for relevant files.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 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,47 @@ | ||
name: Build and Test Project | ||
|
||
on: | ||
push: | ||
paths: | ||
- "src/**" | ||
- "static/**" | ||
- "Cargo.toml" | ||
- ".github/workflows/build-and-test.yml" # This file | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
paths: | ||
- "src/**" | ||
- "static/**" | ||
- "Cargo.toml" | ||
- ".github/workflows/build-and-test.yml" # This file | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rust-src | ||
override: true | ||
|
||
- name: Add Wasm target | ||
run: rustup target add wasm32-unknown-unknown | ||
|
||
- name: Build project | ||
run: cargo build --release | ||
|
||
- name: Test project | ||
run: cargo test |