forked from fedimint/fedimint
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (95 loc) · 3.39 KB
/
hourly-run.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
on:
schedule:
- cron: '30 * * * *' # every hour at `x:30`
workflow_dispatch:
name: Hourly check
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
self-care:
name: Flake self-check
# no one is in the rush for this to funish, so use default (free) Ubuntu instances
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v9
with:
fail-mode: true
nixpkgs-keys: nixpkgs
test:
if: github.repository == 'fedimint/fedimint'
strategy:
matrix:
host:
- linux
include:
- host: linux
# no one is in the rush for this to funish, so use default (free) Ubuntu instances
runs-on: [self-hosted, linux]
timeout: 75
run-tests: true
free-disk-space-ubuntu: false
name: "Test on ${{ matrix.host }}"
runs-on: ${{ matrix.runs-on }}
timeout-minutes: ${{ matrix.timeout }}
steps:
- name: Free Disk Space, Ubuntu, part 1
if: matrix.free-disk-space-ubuntu
run: |
docker rmi `docker images -q`
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo apt clean
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
df -h
- name: Free Disk Space, Ubuntu, part 2
if: matrix.free-disk-space-ubuntu
uses: jlumbroso/free-disk-space@main
with:
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: false
large-packages: true
swap-storage: true
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
connect-timeout = 15
stalled-download-timeout = 15
- uses: cachix/cachix-action@v15
with:
name: fedimint
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
continue-on-error: true
- name: Tests (5 times more)
run: |
set -euo pipefail
# first one might do nothing
nix build -L .#wasm32-unknown.ci.ciTestAll
# but this one will run
nix build -L .#wasm32-unknown.ci.ciTestAll --rebuild
- name: Wasm Tests
run: |
set -euo pipefail
nix build -L .#wasm32-unknown.ci.wasmTest
nix build -L .#wasm32-unknown.ci.wasmTest --rebuild
notifications:
if: always() && github.repository == 'fedimint/fedimint' && github.event_name != 'merge_group'
name: "Notifications"
timeout-minutes: 1
runs-on: [self-hosted, linux]
# note: we don't depend on `audit` because it will
# be often broken, and we can't fix it immediately
needs: [ test ]
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