Publish Docker image + Example CI WF + Upload to dockerhub #11
Workflow file for this run
This file contains hidden or 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: Example Test w/ Published Container | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| permissions: | |
| packages: write | |
| jobs: | |
| publish-test-image: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| container-image: ${{ steps.set-image-name .outputs.container-image }} | |
| k-version: ${{ steps.set-image-name .outputs.k-version }} | |
| kmir-version: ${{ steps.set-image-name .outputs.kmir-version }} | |
| short-sha: ${{ steps.set-image-name .outputs.short-sha }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Docker ghcr.io Login | |
| uses: docker/[email protected] | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Docker Buildx | |
| uses: docker/[email protected] | |
| - name: Set Image Name Parameters | |
| id: set-image-name | |
| run: | | |
| echo "image-name=ghcr.io/runtimeverification/mir-semantics/kmir" >> $GITHUB_OUTPUT | |
| echo "k-version=$(cat deps/k_release)" >> $GITHUB_OUTPUT | |
| echo "kmir-version=$(cat package/version)" >> $GITHUB_OUTPUT | |
| echo "short-sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build Kmir Container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.kmir | |
| platforms: linux/amd64 | |
| push: true | |
| build-args: | | |
| K_VERSION=${{ steps.set-image-name.outputs.k-version }} | |
| tags: ${{ steps.set-image-name.outputs.image-name }}:ubuntu-jammy-${{ steps.set-image-name.outputs.kmir-version }}_${{ steps.set-image-name.outputs.k-version }}-${{ steps.set-image-name.outputs.short-sha }} | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: publish-test-image | |
| container: | |
| image: ${{ needs.publish-test-image.outputs.image-name }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| ref: sample-challenge-11-proofs | |
| - name: kmir Prove | |
| run: | | |
| cd rust-verification-proofs/unchecked_add | |
| kmir prove run $PWD/unchecked-op-spec.k --proof-dir $PWD/proof |