Skip to content

Commit

Permalink
feat(cicd): build and test workflow (#1)
Browse files Browse the repository at this point in the history
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
zpg6 authored Dec 8, 2024
1 parent 5a7a791 commit 582e158
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-and-test.yml
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

0 comments on commit 582e158

Please sign in to comment.