Skip to content

Commit

Permalink
refactor(check-stable): use matrix (#1543) (#1583)
Browse files Browse the repository at this point in the history
* refactor(check-stable): use matrix

* chore: simulate leptos change

* chore: remove simulated change
  • Loading branch information
agilarity authored Aug 25, 2023
1 parent c322ef3 commit cf14e85
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 45 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "check"
toolchain: nightly
47 changes: 11 additions & 36 deletions .github/workflows/check-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,25 @@ name: Check stable

on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
branches:
- main

jobs:
get-leptos-changed:
uses: ./.github/workflows/get-leptos-changed.yml

test:
name: Check examples ${{ matrix.os }} (using rustc ${{ matrix.rust }})
name: Check
needs: [get-leptos-changed]
if: needs.get-leptos-changed.outputs.leptos_changed == 'true'
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust:
- stable
os:
- ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt

- name: Add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown

- name: Setup cargo-make
uses: davidB/rust-cargo-make@v1

- name: Cargo generate-lockfile
run: cargo generate-lockfile

- uses: Swatinem/rust-cache@v2

- name: Run cargo check on all examples
run: cargo make --profile=github-actions check-stable
directory: [examples/counters_stable, examples/counter_without_macros]
uses: ./.github/workflows/run-cargo-make-task.yml
with:
directory: ${{ matrix.directory }}
cargo_make_task: "check"
toolchain: stable
1 change: 1 addition & 0 deletions .github/workflows/ci-changed-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly
15 changes: 6 additions & 9 deletions .github/workflows/run-cargo-make-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@ on:
cargo_make_task:
required: true
type: string
toolchain:
required: true
type: string

env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

jobs:
test:
name: Run ${{ matrix.os }} (using rustc ${{ matrix.rust }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust:
- nightly
os:
- ubuntu-latest
name: Run ${{ inputs.cargo_make_task }} (${{ inputs.toolchain }})
runs-on: ubuntu-latest

steps:
# Setup environment
Expand All @@ -32,7 +29,7 @@ jobs:
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
toolchain: ${{ inputs.toolchain }}
override: true
components: rustfmt

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-all-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly

0 comments on commit cf14e85

Please sign in to comment.