Add invariants to RewardUpdate
#3473
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: Build and upload artifacts | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| # For running the workflow manually - useful for branches without PRs, for | |
| # which CI isn't run automatically | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| formal-ledger-agda: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/6c5963357f3c1c840201eda129a99d455074db04.tar.gz | |
| extra_nix_config: | | |
| trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | |
| substituters = https://cache.iog.io https://cache.nixos.org/ | |
| - name: Build formalLedger | |
| id: formalLedger | |
| run: | | |
| nix-build -A formalLedger -o outputs | |
| - name: Upload agda _build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: _build | |
| path: outputs/_build | |
| - name: Upload agda typechecking time artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: typecheck.time | |
| path: outputs/typecheck.time | |
| hs: | |
| needs: [formal-ledger-agda] | |
| uses: ./.github/workflows/build_artifact.yml | |
| with: | |
| target: hs | |
| cardano-ledger-pdf: | |
| needs: [formal-ledger-agda] | |
| uses: ./.github/workflows/build_artifact.yml | |
| with: | |
| target: cardano-ledger.pdf | |
| conway-ledger-pdf: | |
| needs: [formal-ledger-agda] | |
| uses: ./.github/workflows/build_artifact.yml | |
| with: | |
| target: conway-ledger.pdf | |
| html: | |
| needs: [formal-ledger-agda] | |
| uses: ./.github/workflows/build_artifact.yml | |
| with: | |
| target: html | |
| upload-artifacts: | |
| # This job runs only if the workflow has not been manually dispached | |
| if: ${{ github.event_name != 'workflow_dispatch' }} | |
| needs: [formal-ledger-agda, hs, conway-ledger-pdf, cardano-ledger-pdf, html] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set artifacts_branch variable | |
| id: set-artifacts-branch | |
| run: | | |
| printf "Set the artifacts branch name.\n" | |
| if [[ -n "${{ github.event.pull_request.head.ref }}" ]]; then | |
| printf "This workflow was triggered by a PR to master\n" | |
| echo "artifacts_branch=${{ github.event.pull_request.head.ref }}-artifacts" >> $GITHUB_OUTPUT | |
| printf "artifacts_branch: %s\n" "${{ github.event.pull_request.head.ref }}-artifacts" | |
| else | |
| printf "This workflow was triggered by a push event to master\n" | |
| echo "artifacts_branch=master-artifacts" >> $GITHUB_OUTPUT | |
| printf "artifacts_branch: %s\n" "master-artifacts" | |
| fi | |
| # Checkout env.artifacts_branch if it already exists | |
| # otherwise create a new orphan branch. | |
| # Lastly, remove all files from the repo | |
| - name: Checkout artifacts branch | |
| run: | | |
| if [[ -n "$(git ls-remote --heads origin "${ARTIFACTS_BRANCH}")" ]]; then | |
| git checkout "${ARTIFACTS_BRANCH}" | |
| else | |
| git checkout --orphan "${ARTIFACTS_BRANCH}" | |
| fi | |
| git rm -rf . | |
| env: | |
| ARTIFACTS_BRANCH: ${{ steps.set-artifacts-branch.outputs.artifacts_branch }} | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: '!_build' | |
| merge-multiple: true | |
| - name: Generate website | |
| run: | | |
| cat << EOF > index.html | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <meta name="Author" content="IOHK"> | |
| <title>Formal Ledger Specifications</title> | |
| <style type="text/css"> | |
| BODY { font-family : monospace, sans-serif; color: black;} | |
| P { font-family : monospace, sans-serif; color: black; margin:0px; padding: 0px;} | |
| A:visited { text-decoration : none; margin : 0px; padding : 0px;} | |
| A:link { text-decoration : none; margin : 0px; padding : 0px;} | |
| A:hover { text-decoration: underline; background-color : yellow; margin : 0px; padding : 0px;} | |
| A:active { margin : 0px; padding : 0px;} | |
| .VERSION { font-size: small; font-family : arial, sans-serif; } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Directory Tree</h1><p> | |
| EOF | |
| tree -H '.' \ | |
| -L 1 \ | |
| --dirsfirst \ | |
| --hintro=/dev/null \ | |
| --houtro=/dev/null \ | |
| --metafirst \ | |
| --charset utf-8 \ | |
| --timefmt '%d-%b-%Y %H:%M' \ | |
| -I "index.html" \ | |
| -I "hs" \ | |
| -h -D --du \ | |
| >> index.html | |
| cat << EOF >> index.html | |
| <hr> | |
| <p class="VERSION"> | |
| Automatically generated from commit <a href="https://github.com/intersectmbo/formal-ledger-specifications/commit/${{ github.sha }}">${{ github.sha }}</a> | |
| </p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Commit artifacts | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add -A | |
| git commit -m "Artifacts generated from ${{ github.sha }}" | |
| - name: Push ${{ env.artifacts_branch }} | |
| uses: ad-m/[email protected] | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ steps.set-artifacts-branch.outputs.artifacts_branch }} | |
| force: true | |
| build-cardano-ledger: | |
| needs: [hs] | |
| if: ${{ github.event_name == 'push' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/6c5963357f3c1c840201eda129a99d455074db04.tar.gz | |
| extra_nix_config: | | |
| trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | |
| substituters = https://cache.iog.io https://cache.nixos.org/ | |
| - name: Checkout prepare-conf-test.sh | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| scripts/prepare-conf-test.sh | |
| sparse-checkout-cone-mode: false | |
| path: fls | |
| - name: Checkout cardano-ledger | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: IntersectMBO/cardano-ledger | |
| path: cl | |
| fetch-depth: 0 | |
| - name: Download hs artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: hs | |
| - name: Build cardano-ledger | |
| run: | | |
| cd cl | |
| nix develop --command bash -c "../fls/scripts/prepare-conf-test.sh . ../hs && cabal update && cabal build cardano-ledger-conformance" |