Skip to content

Commit

Permalink
chore(ci): update and add auto-release
Browse files Browse the repository at this point in the history
  • Loading branch information
tversteeg committed Oct 25, 2023
1 parent 1324af9 commit fa0edb3
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ on:
paths-ignore:
- "docs/**"
- "**.md"
pull_request:
paths-ignore:
- "docs/**"
- "**.md"

jobs:
# Check for formatting
rustfmt:
name: Formatter check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
Expand All @@ -30,41 +26,41 @@ jobs:
command: fmt
args: --all -- --check

# Run compile check on Linux, macOS, and Windows
compile:
name: Compile
# Run test check on Linux, macOS, and Windows
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
# Checkout the branch being tested
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install rust stable
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

# Cache the built dependencies
- uses: Swatinem/rust-cache@v2.4.0
- uses: Swatinem/rust-cache@v2.7.1
with:
save-if: ${{ github.event_name == 'push' }}

# Install cargo-hack
- uses: taiki-e/install-action@cargo-hack

# Compile all feature combinations on the target platform
- name: Compile
run: cargo hack --feature-powerset check
# Test all feature combinations on the target platform
- name: Test
run: cargo hack --feature-powerset test

# Build the WASM target & push it to GitHub pages
wasm:
name: WASM build
name: WASM test & build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install rust stable
- uses: dtolnay/rust-toolchain@master
Expand All @@ -73,7 +69,7 @@ jobs:
targets: wasm32-unknown-unknown

# Cache the built dependencies
- uses: Swatinem/rust-cache@v2.4.0
- uses: Swatinem/rust-cache@v2.7.1
with:
save-if: ${{ github.event_name == 'push' }}

Expand All @@ -87,5 +83,5 @@ jobs:
env:
REPO: self
BRANCH: gh-pages
FOLDER: target/wasm-examples/castle-game
FOLDER: target/wasm-examples/sprite
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit fa0edb3

Please sign in to comment.