This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
Update rust.yml #2
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
To modify the GitHub Actions workflow to build the Rust project for Windows, you can add a new job that runs on a Windows runner (`windows-latest`). Here is an updated version of your workflow file: | ||
```yaml | ||
name: Rust | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: cargo build --verbose | ||
# - name: Run tests | ||
# run: cargo test --verbose | ||
build-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: rustup install stable-x86_64-pc-windows-msvc | ||
- name: Set up Rust toolchain | ||
run: rustup default stable-x86_64-pc-windows-msvc | ||
- name: Build | ||
run: cargo build --verbose | ||
# - name: Run tests | ||
# run: cargo test --verbose |