-
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.
Switch to GitHub Actions (lambda-fairy#244)
Closes lambda-fairy#243
- Loading branch information
1 parent
167afc6
commit 24593d8
Showing
2 changed files
with
124 additions
and
53 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,124 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: '0 1 * * *' | ||
|
||
jobs: | ||
main: | ||
name: Main | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
components: clippy | ||
|
||
- name: Run tests | ||
run: cargo test --workspace | ||
|
||
- name: Check Clippy | ||
# TODO(#209): Use `--all-targets` | ||
run: cargo clippy --workspace -- -D warnings | ||
|
||
# Optional features (i.e. web framework integrations) take a long time to | ||
# build and rarely break. Speed up CI by checking them separately. | ||
all-features: | ||
name: All features | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
|
||
- name: Check build | ||
run: cargo check --workspace --all-features --all-targets | ||
|
||
benchmarks: | ||
name: Benchmarks | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
|
||
- name: Run benchmarks | ||
run: cd benchmarks && cargo test --benches --locked | ||
|
||
documentation: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
with: | ||
# Documentation build uses `git describe` which requires history | ||
fetch-depth: 0 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
|
||
- name: Build documentation | ||
run: cd docs && make -j$(nproc) | ||
|
||
rustfmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
# rustfmt is often missing on nightly. Since there's little benefit to | ||
# using the nightly version, use the more reliable stable build instead. | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
components: rustfmt | ||
|
||
- name: Check formatting | ||
run: | | ||
cargo fmt -- --check | ||
(cd benchmarks && cargo fmt -- --check) | ||
(cd docs && cargo fmt -- --check) | ||
# trybuild harnesses are technically not part of the Cargo project, so | ||
# need to be checked separately | ||
rustfmt --check maud/tests/warnings/*.rs |
This file was deleted.
Oops, something went wrong.