prop/.forgejo/workflows/build-grid-rs.yaml
Graham McIntire 39f899ce2e
Some checks failed
Build base image / Build and push base image (push) Failing after 3s
Build prop-grid-rs / Test, build, push (push) Failing after 2s
Build and Push / Build and Push Docker Image (push) Failing after 2s
fix: use forgejo action mirrors, add pre-build compile and clippy checks
2026-07-27 08:55:38 -05:00

62 lines
1.7 KiB
YAML

name: Build prop-grid-rs
on:
push:
branches:
- main
paths:
- 'rust/prop_grid_rs/**'
- '.forgejo/workflows/build-grid-rs.yaml'
env:
REGISTRY: git.mcintire.me
IMAGE_NAME: graham/prop-grid-rs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push:
name: Test, build, push
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: https://code.forgejo.org/actions/checkout@v4
- name: Generate image tag
id: tag
run: |
TIMESTAMP=$(date +%s)
SHORT_SHA=$(git rev-parse --short=7 HEAD | cut -c1-7)
TAG="main-${TIMESTAMP}-${SHORT_SHA}"
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Run clippy and tests
working-directory: rust/prop_grid_rs
run: |
cargo clippy --all-targets -- -D warnings
cargo test --release
- name: Build and push via Kaniko
uses: graham/infra/.forgejo/actions/kaniko-build@main
with:
context: rust/prop_grid_rs
token: ${{ secrets.FORGEJO_TOKEN }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tag: ${{ steps.tag.outputs.tag }}
- name: Tag as latest and main
uses: graham/infra/.forgejo/actions/kaniko-build@main
with:
context: rust/prop_grid_rs
token: ${{ secrets.FORGEJO_TOKEN }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tag: latest
extra_args: ""