Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PR build workflow #78

Merged
merged 11 commits into from
Jun 4, 2024
49 changes: 49 additions & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PR Build & Test

on:
pull_request:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
branches:
- main

env:
RUSTFLAGS: -Dwarnings

jobs:
check:
runs-on: windows-2019
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved

strategy:
matrix:
# Apparently ARM targets aren't usable in GH actionsd
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
# target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, aarch64-pc-windows-msvc]
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc]
branding: [Inbox, Stable, Dev]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update toolchain
run: rustup update --no-self-update stable && rustup default stable-${{ matrix.target }}

- name: Add toolchain target
run: rustup target add ${{ matrix.target }}

- name: Install fmt
run: rustup component add rustfmt

- name: Clean
run: cargo clean

- name: Run fmt
run: cargo fmt --all -- --check

# Test will build the code, then also test it.
- name: Test
run: cargo test --no-default-features --features ${{matrix.branding}} --target ${{ matrix.target }}

- name: Run clippy
run: cargo clippy --no-default-features --features ${{matrix.branding}} --target ${{matrix.target}} --frozen --release 2>&1
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
Loading