Skip to content

CI

CI #2352

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
# Allow rebuilding/redeploying the web manually
workflow_dispatch:
schedule:
# Rebuild the web periodically at 22:00 UTC to update team API contents and Rust version
- cron: '0 22 * * *'
env:
RUST_BACKTRACE: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: Swatinem/rust-cache@v2
- name: Test
run: |
set -euo pipefail
# Check if the code is good
cargo build --all --locked
cargo clippy -- --deny warnings
cargo test --all --locked
- name: Formatting
run: cargo fmt --all -- --check
- name: Build website
run: cargo run
env:
BASE_URL: "/"
- name: Disable Jekyll
run: touch build/.nojekyll
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload website
uses: actions/upload-pages-artifact@v3
with:
path: build
deploy:
needs: [ build ]
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
environment:
name: github-pages
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4