Skip to content

Improve ci pipeline #20

Improve ci pipeline

Improve ci pipeline #20

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
# prepare:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# attestations: write
# id-token: write
# outputs:
# tag: ${{ steps.meta.outputs.tags }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Log in to the Container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# - name: Build and push Docker image
# id: push
# uses: docker/build-push-action@v6
# with:
# context: ./.github/
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache-id
with:
path: ${{ runner.temp }}/ci-cache
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/setup.sh')}}
# Required action
- uses: airvzxf/[email protected]
with:
script: 'setup.sh'
is_cached: ${{ steps.cache-id.outputs.cache-hit }}
cache: ${{ runner.temp }}/ci-cache
- name: Build
run: just build
# clippy:
# runs-on: ubuntu-latest
# container:
# image: ${{ needs.prepare.outputs.tag }}
# needs: prepare
# steps:
# - uses: actions/checkout@v4
# - name: Run clippy
# run: just clippy
# cargo-fmt:
# runs-on: ubuntu-latest
# container:
# image: ${{ needs.prepare.outputs.tag }}
# needs: prepare
# steps:
# - uses: actions/checkout@v4
# - name: Build autogenerated files
# run: cargo check
# - name: Check formatting
# run: cargo fmt --check
# unit-tests:
# runs-on: ubuntu-latest
# container:
# image: ${{ needs.prepare.outputs.tag }}
# needs: prepare
# steps:
# - uses: actions/checkout@v4
# - name: Run unit-tests
# run: just unit-test
# miri:
# runs-on: ubuntu-latest
# container:
# image: ${{ needs.prepare.outputs.tag }}
# needs: prepare
# steps:
# - uses: actions/checkout@v4
# - name: Install miri
# run: rustup component add miri
# - name: Run miri
# run: just miri
# system-tests:
# runs-on: ubuntu-latest
# container:
# image: ${{ needs.prepare.outputs.tag }}
# needs: prepare
# steps:
# - uses: actions/checkout@v4
# - name: Build
# run: just system-test