Skip to content

Commit

Permalink
Switch to GitHub Actions (lambda-fairy#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-fairy authored Dec 23, 2020
1 parent 167afc6 commit 24593d8
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 53 deletions.
124 changes: 124 additions & 0 deletions .github/workflows/ci.yml
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
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

0 comments on commit 24593d8

Please sign in to comment.