chore(clippy): ... #775
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: Rust | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install lld | |
run: sudo apt-get update && sudo apt-get install -y lld wget unzip | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --workspace | |
- name: 'Create env file' | |
run: | | |
echo "${{ secrets.ENV_FILE }}" > .env | |
- name: Test (dependabot) | |
if: github.actor == 'dependabot[bot]' | |
run: cargo test --workspace --features disable-test-dependabot | |
- name: Test | |
if: github.actor != 'dependabot[bot]' | |
run: cargo test --workspace | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: clippy | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Fmt | |
run: cargo fmt --all -- --check | |
- name: Check | |
run: cargo check --all-targets --all-features --workspace | |
- name: Clippy | |
run: cargo clippy --all-targets --all-features --workspace -- -D warnings | |
devcontainer: | |
name: Devcontainer build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: 'Create env file' | |
run: | | |
echo "${{ secrets.ENV_FILE }}" > .env | |
- name: Build Devcontainer | |
uses: devcontainers/[email protected] | |
with: | |
imageName: ghcr.io/ssoudan/sapiens-devcontainer | |
cacheFrom: ghcr.io/ssoudan/sapiens-devcontainer:latest | |
push: always | |
- name: Run in Devcontainer | |
uses: devcontainers/[email protected] | |
with: | |
cacheFrom: ghcr.io/ssoudan/sapiens-devcontainer:latest | |
push: never | |
runCmd: | | |
cargo check --all-targets --all-features --workspace |