Skip to content

ci

ci #176

Workflow file for this run

name: ci
on:
push:
branches:
- main
tags-ignore:
- v*
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: 0 4/8 * * *
env:
IS_SCHEDULE: ${{ github.event_name == 'schedule' && 'true' || '' }}
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Determine toolchain
run: |
if [ -z $IS_SCHEDULE ]; then
toolchain=$(grep channel rust-toolchain.toml | sed -r 's/channel = "(.*)"/\1/')
else
toolchain='nightly'
fi
echo "setting RUSTUP_TOOLCHAIN to $toolchain"
echo "RUSTUP_TOOLCHAIN=$toolchain" >> "$GITHUB_ENV"
- name: Install Rust toolchain
run: |
rustup toolchain install $RUSTUP_TOOLCHAIN
rustup component add clippy
- name: Install just
uses: taiki-e/install-action@v2
with:
tool: just
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Check code format
run: just fmt_check
- name: Run linter
run: just lint
- name: Run tests
run: just test
- name: Run doc
run: just doc