-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): automatically release with release-plz and simplify test CI
- Loading branch information
Showing
2 changed files
with
41 additions
and
55 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Release | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-plz: | ||
name: Release PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Install required libraries | ||
- name: Install dependencies | ||
run: sudo apt-get install -y libasound2-dev | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Run release-plz | ||
uses: MarcoIeni/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +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: | ||
|
@@ -29,63 +26,19 @@ jobs: | |
command: fmt | ||
args: --all -- --check | ||
|
||
# Run compile check on Linux, macOS, and Windows | ||
# On both Rust stable and Rust nightly | ||
compile: | ||
name: Compile | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
toolchain: [stable, nightly] | ||
steps: | ||
# Checkout the branch being tested | ||
- uses: actions/checkout@v3 | ||
|
||
# Install rust | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
|
||
# Cache the built dependencies | ||
- uses: Swatinem/[email protected] | ||
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 | ||
|
||
# Run tests on Linux | ||
# On both Rust stable and Rust nightly | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [stable, nightly] | ||
steps: | ||
# Checkout the branch being tested | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
# Install rust | ||
# Install rust stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
|
||
# Cache the built dependencies | ||
- uses: Swatinem/[email protected] | ||
with: | ||
save-if: ${{ github.event_name == 'push' }} | ||
|
||
# Install cargo-hack | ||
- uses: taiki-e/install-action@cargo-hack | ||
toolchain: stable | ||
|
||
# Run the ignored tests that expect the above setup | ||
- name: Run all tests | ||
run: cargo hack --feature-powerset test | ||
# Run the tests | ||
- name: Test | ||
run: cargo test |