mit-plv / fiat-crypto

Cryptographic Primitive Code Generation by Fiat
http://adam.chlipala.net/papers/FiatCryptoSP19/FiatCryptoSP19.pdf
Other
717 stars 147 forks source link

Use the same docker image in validate and build docker jobs on master #1900

Closed JasonGross closed 6 months ago

JasonGross commented 6 months ago

Here we have a failure due to the Coq image being updated between jobs. We can figure out the tag either with https://github.com/coq-community/docker-coq-action/pull/89 or by parsing docker images --format "{{.Repository}}:{{.Tag}}". We can then emit output with something like echo "::set-output name=coq_image_tag::$coq_image_tag" and something like

name: Example Workflow

on: [push]

jobs:
  set-output-job:
    runs-on: ubuntu-latest
    outputs:
      coq_image_tag: ${{ steps.set-output-step.outputs.coq_image_tag }}
    steps:
      - name: Set coq_image_tag Output
        id: set-output-step
        run: |
          # Simulate obtaining some value; in this case, we use a hard-coded string
          echo "COQ_IMAGE_TAG=dev" > result.txt

          # Extract the value and set it as output for the job
          coq_image_tag=$(cat result.txt | cut -d= -f2)
          echo "::set-output name=coq_image_tag::$coq_image_tag"

  fetch-output-job:
    needs: set-output-job
    runs-on: ubuntu-latest
    steps:
      - name: Fetch coq_image_tag from Previous Job
        run: echo "COQ_IMAGE_TAG is ${{ needs.set-output-job.outputs.coq_image_tag }}"