PLT-7654 Re-benchmarked Runtime resources and syncing. #4558
Workflow file for this run
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: "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= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=" | |
SUBSTITUTERS: "https://cache.nixos.org/ https://cache.iog.io https://marlowe-temp.cachix.org https://cache.zw3rk.com/" | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
jobs: | |
integration: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v21 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
install_url: https://releases.nixos.org/nix/nix-2.10.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@v12 | |
with: | |
name: ${{ env.CACHE_NAME }} | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Evaluate test derivation | |
run: | | |
nix build --dry-run --json .#integration-tests > test-store-path.json | |
- name: Cache test results | |
id: cache-results | |
uses: actions/cache@v3 | |
with: | |
# Use run_attempt in the cache key so that explicitly re-running the | |
# tests will force the test to run again. | |
key: ${{ runner.os }}-integration-tests-${{ hashFiles('test-store-path.json') }}-${{ github.run_attempt }} | |
path: | | |
~/integration-tests.log | |
~/integration-tests.status | |
- if: ${{ steps.cache-results.outputs.cache-hit != 'true' }} | |
name: Run tests | |
run: | | |
nix run .#integration-tests --show-trace -- --strict > ~/integration-tests.log | |
echo $? > ~/integration-tests.status | |
exit $? | |
env: | |
MARLOWE_RT_TEST_DB_HOST: localhost | |
MARLOWE_RT_TEST_CLEANUP_DATABASE: "False" | |
MARLOWE_RT_TEST_SUBMIT_CONFIRMATION_BLOCKS: 0 | |
- if: ${{ failure() && steps.cache-results.outputs.cache-hit != 'true' }} | |
name: Upload failed test directories as artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: workspaces | |
path: | | |
/tmp/workspaces | |
!/tmp/workspaces/**/*.socket | |
- if: ${{ steps.cache-results.outputs.cache-hit == 'true' }} | |
name: Display cached test results | |
run: | | |
echo "Using cached test results. Test log:" | |
cat ~/integration-tests.log | |
exit $(cat ~/integration-tests.status) |