CI #2096
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: install | |
run: | | |
rustup override set stable | |
rustup update stable | |
- name: restore build & cargo cache | |
uses: Swatinem/rust-cache@v2 | |
- name: run tests | |
run: cargo test | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: install | |
run: | | |
rustup override set stable | |
rustup update stable | |
rustup component add rustfmt | |
- run: cargo fmt -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: install | |
run: | | |
rustup override set stable | |
rustup update stable | |
rustup component add clippy | |
- name: restore build & cargo cache | |
uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --workspace --locked -- -D warnings | |
docker: | |
runs-on: ubuntu-latest | |
env: | |
# Heroku doesn't support docker buildkit, so we have to ensure | |
# that the build works without it. | |
DOCKER_BUILDKIT: 0 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build docker image via docker-compose | |
run: docker compose build web | |
- name: start webserver | |
run: docker compose up web --wait | |
- name: test HTTP request | |
run: | | |
sudo apt-get install -y curl | |
curl \ | |
--fail \ | |
--show-error \ | |
--connect-timeout 10 \ | |
http://localhost:8000/ht | |
- name: stop webserver | |
run: docker compose down |