forked from Leafwing-Studios/leafwing-input-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a faster, cached CI setup (Leafwing-Studios#333)
* Borrow CI setup from Emergence https://github.com/Leafwing-Studios/Emergence * Stricter link format checking * Fix doc links
- Loading branch information
1 parent
97ab7ed
commit 421a0b9
Showing
18 changed files
with
177 additions
and
136 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 |
---|---|---|
|
@@ -2,108 +2,79 @@ name: CI | |
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
toolchain: [stable] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
check-lints: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
override: true | ||
- name: Cache Cargo build files | ||
uses: Leafwing-Studios/[email protected] | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev | ||
if: runner.os == 'linux' | ||
- name: Build & run tests | ||
run: cargo test --workspace | ||
env: | ||
RUSTFLAGS: "-C debuginfo=0 -D warnings" | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
- name: CI job | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- lints | ||
|
||
ci: | ||
check-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
override: true | ||
- name: Cache Cargo build files | ||
uses: Leafwing-Studios/[email protected] | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev | ||
if: runner.os == 'linux' | ||
- name: CI job | ||
- name: Build & run tests | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci | ||
run: cargo run -p ci -- test | ||
env: | ||
RUSTFLAGS: "-C debuginfo=0 -D warnings" | ||
|
||
check-markdown-links: | ||
check-compiles: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: check dead links | ||
continue-on-error: true | ||
id: run1 | ||
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec | ||
with: | ||
use-quiet-mode: "yes" | ||
use-verbose-mode: "yes" | ||
config-file: ".github/linters/markdown-link-check.json" | ||
- name: Sleep for 30 seconds | ||
if: steps.run1.outcome=='failure' | ||
run: sleep 30s | ||
shell: bash | ||
- name: check dead links (retry) | ||
continue-on-error: true | ||
id: run2 | ||
if: steps.run1.outcome=='failure' | ||
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec | ||
with: | ||
use-quiet-mode: "yes" | ||
use-verbose-mode: "yes" | ||
config-file: ".github/linters/markdown-link-check.json" | ||
- name: Sleep for 30 seconds | ||
if: steps.run2.outcome=='failure' | ||
run: sleep 30s | ||
shell: bash | ||
- name: check dead links (retry 2) | ||
continue-on-error: true | ||
id: run3 | ||
if: steps.run2.outcome=='failure' | ||
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
use-quiet-mode: "yes" | ||
use-verbose-mode: "yes" | ||
config-file: ".github/linters/markdown-link-check.json" | ||
- name: set the status | ||
if: always() | ||
run: | | ||
if ${{ steps.run1.outcome=='success' || steps.run2.outcome=='success' || steps.run3.outcome=='success' }}; then | ||
echo success | ||
else | ||
exit 1 | ||
fi | ||
toolchain: stable | ||
override: true | ||
- name: Cache Cargo build files | ||
uses: Leafwing-Studios/[email protected] | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev | ||
- name: Check Compile | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- compile | ||
|
||
markdownlint: | ||
check-doc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
- name: Run Markdown Lint | ||
uses: docker://ghcr.io/github/super-linter:slim-v4 | ||
toolchain: stable | ||
- name: Cache Cargo build files | ||
uses: Leafwing-Studios/[email protected] | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
if: runner.os == 'linux' | ||
- name: Build and check doc | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- doc | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
VALIDATE_MARKDOWN: true | ||
DEFAULT_BRANCH: main | ||
RUSTFLAGS: "-C debuginfo=0" |
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.