---
name: Rust
on:
push:
paths:
- ".devcontainer.json"
- ".github/workflows/**/*"
- "**.rs"
- "**.toml"
workflow_dispatch:
jobs:
check-and-test:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Login to GHCR.
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: lower-repo
name: Convert Repo Name to Lowercase
run: |
echo "repo=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
- name: Build Devcontainer and Run Checks and Tests
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/${{ steps.lower-repo.outputs.repo }}/devcontainer
cacheFrom: ghcr.io/${{ steps.lower-repo.outputs.repo }}/devcontainer
push: filter
refFilterForPush: refs/heads/main
runCmd: |
cargo fmt --check
cargo clippy
cargo test