diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..d6abbe4 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -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