generated from tversteeg/library-github-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
90 additions
and
104 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,8 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:base", | ||
":automergeAll", | ||
":automergeBranch" | ||
] | ||
} |
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: Readme | ||
on: push | ||
|
||
jobs: | ||
# Generate the readme from lib.rs | ||
readme: | ||
name: Generate README.md | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Needed for the amend | ||
fetch-depth: 2 | ||
|
||
- uses: cargo-bins/cargo-binstall@main | ||
|
||
- name: Install cargo-rdme | ||
run: cargo binstall cargo-rdme -y | ||
|
||
- name: Get last commit message | ||
id: last-commit-message | ||
run: | | ||
echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT | ||
- name: Run cargo-rdme | ||
run: cargo rdme | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: ${{ steps.last-commit-message.outputs.msg }} | ||
commit_options: '--amend --no-edit' | ||
push_options: '--force' | ||
skip_fetch: true |
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,29 @@ | ||
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 | ||
|
||
- 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,131 +4,53 @@ on: | |
paths-ignore: | ||
- "docs/**" | ||
- "**.md" | ||
pull_request: | ||
paths-ignore: | ||
- "docs/**" | ||
- "**.md" | ||
|
||
jobs: | ||
# Run the `rustfmt` code formatter | ||
# Check for formatting | ||
rustfmt: | ||
name: Rustfmt [Formatter] | ||
name: Formatter check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: rustfmt | ||
override: true | ||
|
||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
# Run the `clippy` linting tool | ||
clippy: | ||
name: Clippy [Linter] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: sudo apt-get install -y libsdl2-dev libasound2-dev | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-targets --all-features -- -D clippy::all | ||
|
||
# Run a security audit on dependencies | ||
cargo_audit: | ||
name: Cargo Audit [Security] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- run: cargo install --force cargo-audit | ||
- run: cargo generate-lockfile | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: audit | ||
|
||
# Ensure that the project could be successfully compiled | ||
cargo_check: | ||
name: Compile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: sudo apt-get install -y libsdl2-dev libasound2-dev | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --all | ||
|
||
# Run tests on Linux | ||
# On both Rust stable and Rust nightly | ||
# Run test check on Linux, macOS, and Windows | ||
test: | ||
name: Test Suite | ||
needs: [cargo_check] | ||
name: Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
rust: [stable, nightly] | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
steps: | ||
# Checkout the branch being tested | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v4 | ||
|
||
# Install all the required dependencies for testing | ||
- uses: actions-rs/toolchain@v1 | ||
# Install rust stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
# Install Node.js at a fixed version | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.0" | ||
|
||
# Install Ruby at a fixed version | ||
- uses: actions/setup-ruby@v1 | ||
# Cache the built dependencies | ||
- uses: Swatinem/[email protected] | ||
with: | ||
ruby-version: "2.6" | ||
save-if: ${{ github.event_name == 'push' }} | ||
|
||
# Install Python at a fixed version | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.7" | ||
|
||
# Install dotnet at a fixed version | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: "2.2.402" | ||
# Install cargo-hack | ||
- uses: taiki-e/install-action@cargo-hack | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get install -y libsdl2-dev libasound2-dev | ||
|
||
# Run the ignored tests that expect the above setup | ||
- name: Run all tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: -- -Z unstable-options --include-ignored | ||
# Test all feature combinations on the target platform | ||
- name: Test | ||
run: cargo hack --feature-powerset test |
This file was deleted.
Oops, something went wrong.