+
name: "Build & test using cabal"
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
+
- package: plutus-merkle-tree
+
- package: hydra-cluster
+
- name: 📥 Checkout repository to latest master
+
repository: input-output-hk/hydra
+
token: ${{ secrets.MY_TOKEN || github.token }}
+
# Also ensure we have all history with all tags
+
- name: Get last relase version tag
+
echo "RELEASE_VERSION=$(echo $(git describe --abbrev=0 --tags))" >> $GITHUB_OUTPUT
+
- name: 📥 Checkout repository to latest released version
+
repository: input-output-hk/hydra
+
token: ${{ secrets.MY_TOKEN || github.token }}
+
# Also ensure we have all history with all tags
+
ref: ${{ steps.latest_tag.outputs.RELEASE_VERSION }}
+
accept-flake-config = true
+
- name: ❄ Cachix cache of nix derivations
+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+
- name: 🔁 Github cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
+
cabal-${{ runner.os }}-${{ hashFiles('cabal.project', 'default.nix', 'shell.nix') }}-${{ matrix.package }}
+
cabal-${{ runner.os }}-${{ hashFiles('cabal.project', 'default.nix', 'shell.nix') }}
+
- name: 🧰 Prepare tools
+
nix develop .#ci --command bash -c 'cabal update'
+
nix develop .#ci --command bash -c 'cabal build ${{ matrix.package }}'
+
if: ${{ matrix.package != 'hydra-tui' }}
+
nix develop .#ci --command bash -c 'cabal test ${{ matrix.package }}'
+
if: ${{ matrix.package == 'hydra-tui' }}
+
# https://giters.com/gfx/example-github-actions-with-tty
+
# The default shell does not allocate a TTY which breaks some tests
+
shell: 'script -q -e -c "bash {0}"'
+
# TUI specs are flaky. They are failing because of SIGSEGV.
+
# There is an open issue to tackle this problem. https://github.com/input-output-hk/hydra/issues/590
+
continue-on-error: true
+
nix develop .#ci --command bash -c 'cabal test ${{ matrix.package }}'
+
- name: 💾 Upload build & test released artifacts
+
name: test-results-released
+
name: "Haddock & benchmarks"
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
+
options: '--output-directory $(pwd)/docs/benchmarks'
+
options: '--scaling-factor 1'
+
- bench: plutus-merkle-tree
+
options: '$(pwd)/docs/benchmarks'
+
- name: 📥 Checkout repository to latest master
+
repository: input-output-hk/hydra
+
token: ${{ secrets.MY_TOKEN || github.token }}
+
# Also ensure we have all history with all tags
+
- name: Get last relase version tag
+
echo "RELEASE_VERSION=$(echo $(git describe --abbrev=0 --tags))" >> $GITHUB_OUTPUT
+
- name: 📥 Checkout repository to latest released version
+
repository: input-output-hk/hydra
+
token: ${{ secrets.MY_TOKEN || github.token }}
+
# Also ensure we have all history with all tags
+
ref: ${{ steps.latest_tag.outputs.RELEASE_VERSION }}
+
accept-flake-config = true
+
- name: ❄ Cachix cache of nix derivations
+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+
- name: 🔁 Github cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
+
cabal-${{ runner.os }}-${{ hashFiles('cabal.project', 'default.nix', 'shell.nix') }}
+
- name: 🧰 Prepare tools
+
nix develop .#ci --command bash -c 'cabal update'
+
nix develop .#ci --command bash -c 'cabal bench ${{ matrix.bench }} --benchmark-options "${{ matrix.options }}"'
+
- name: 📚 Documentation (Haddock)
+
nix develop .#ci --command bash -c '.github/workflows/ci-haddock.sh'
+
- name: 💾 Upload build & test released artifacts
+
name: benchmarks-and-haddocks-released
+
needs: [haddock-benchmarks,build-test]
+
- name: 📥 Checkout repository to latest master
+
repository: input-output-hk/hydra
+
token: ${{ secrets.MY_TOKEN || github.token }}
+
# Also ensure we have all history with all tags
+
- name: Get last relase version tag
+
echo "RELEASE_VERSION=$(echo $(git describe --abbrev=0 --tags))" >> $GITHUB_OUTPUT
+
- name: 📥 Checkout repository to latest released version