Skip to content

Merge pull request #4347 from dpc/24-02-16-export-overlays #1

Merge pull request #4347 from dpc/24-02-16-export-overlays

Merge pull request #4347 from dpc/24-02-16-export-overlays #1

# This is a basic workflow to help you get started with Actions
name: "Backwards-Compatibility"
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch and release tags
push:
branches: [ "main", "master", "devel", "releases/v*" ]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [ "main", "master", "devel", "releases/v*" ]
merge_group:
branches: [ "main", "master", "devel", "releases/v*" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tests:
if: github.repository == 'fedimint/fedimint'
name: "Backwards-compatibility tests"
runs-on: buildjet-8vcpu-ubuntu-2004
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v14
with:
name: fedimint
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
continue-on-error: true
- name: Backwards-compatibility tests
run: |
# the default tmp dir is too long (/home/ubuntu/actions-runner/_work/_temp/)
# we need to use `nix develop -c` to be able to use `nix build` inside of backwards-compatibility-test
env TMPDIR=/tmp nix develop -c ./scripts/tests/backwards-compatibility-test.sh
- name: Prepare failed test build dirs
if: always()
run: |
set -x
# delete source and target artifacts as it is huge and rather useless now
sudo rm -Rf /tmp/nix-build-*/source || true
# chown so actions/upload-artifact can access it
sudo chown -R $USER /tmp/nix-build-* || true
# delete unix sockets, as actions/upload-artifact can't handle them
find /tmp/nix-build-* -type s -print0 | xargs -0 rm || true
- name: Upload failed test build dirs
if: always()
uses: actions/upload-artifact@v4
with:
name: "fedimint-failed-test-logs-${{ github.run_number }}-${{ matrix.host}}"
path: |
/tmp/nix-build-*/
!/tmp/nix-build-*/source/
notifications:
if: always() && github.repository == 'fedimint/fedimint'
name: "Notifications"
timeout-minutes: 1
runs-on: ubuntu-22.04
needs: [ tests ]
steps:
- name: Discord notifications on failure
# https://stackoverflow.com/a/74562058/134409
if: ${{ always() && contains(needs.*.result, 'failure') }}
# https://github.com/marketplace/actions/actions-status-discord
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
# current job is a success, but that's not what we're interested in
status: failure