Nightly Tests #570
This file contains 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: "Nightly Tests" | |
env: | |
CACHE_NAME: marlowe-temp | |
ALLOWED_URIS: "https://github.com https://api.github.com" | |
TRUSTED_PUBLIC_KEYS: "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= marlowe-temp.cachix.org-1:1gPjVFpu4QjaAT3tRurCioX+BC23V7mjvFwpP5bV0Ec=" | |
SUBSTITUTERS: "https://cache.nixos.org/ https://cache.iog.io https://marlowe-temp.cachix.org" | |
on: | |
schedule: | |
# Run at 00:00 UTC every day | |
- cron: 0 0 * * * | |
# Allow running manually | |
workflow_dispatch: | |
jobs: | |
check-deploy: | |
# Disable this job for now, we need to get automatic deploys working again and | |
# make the version of the latest deploy inspectable. | |
# Reenable the dependency of the other jobs on this one when enabled | |
if: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check deploy | |
run: | | |
CURRENT_DEPLOY=$(curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/input-output-hk/marlowe-cardano/actions/workflows/deploy.yml/runs\?per_page\=1\&branch\=main\&status\=success | jq --raw-output '.workflow_runs[0].head_sha') | |
if [ $CURRENT_DEPLOY != $GITHUB_SHA ]; | |
then | |
echo "Unable to run nightly tests on $GITHUB_SHA, currently deployed commit is $CURRENT_DEPLOY" | |
exit 1 | |
fi | |
marlowe-benchmark: | |
runs-on: ubuntu-latest | |
# Dependency disabled pending automatic deploys | |
# needs: [check-deploy] | |
env: | |
ENVIRONMENT: preview | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@V27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
install_url: https://releases.nixos.org/nix/nix-2.20.3/install | |
extra_nix_config: | | |
allowed-uris = ${{ env.ALLOWED_URIS }} | |
trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }} | |
substituters = ${{ env.SUBSTITUTERS }} | |
experimental-features = nix-command flakes | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v15 | |
with: | |
name: ${{ env.CACHE_NAME }} | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Copy Signing Keys | |
env: | |
TEST_WALLET_SIGNING_KEYS: ${{ secrets.TEST_WALLET_SIGNING_KEYS }} | |
run: | | |
i=0 | |
while IFS= read -r key | |
do | |
echo $key | jq . > test-wallets/test.$i.skey | |
i=$((i+1)) | |
done < <(printf '%s\n' "$TEST_WALLET_SIGNING_KEYS") | |
- name: Run Marlowe Benchmark on Preview | |
run: | | |
nix run nixpkgs#socat -- \ | |
UNIX-LISTEN:node.socket,fork,reuseaddr,unlink-early \ | |
TCP:cardano-node-preview.scdev.aws.iohkdev.io:8090 & | |
nix run .#marlowe-benchmark -- \ | |
--host marlowe-runtime-preview.scdev.aws.iohkdev.io \ | |
--port 3700 \ | |
--node-socket-path node.socket \ | |
--testnet-magic 2 \ | |
--address "$(cat test-wallets/test.0.addr)" \ | |
--signing-key-file test-wallets/test.0.skey |