-
Notifications
You must be signed in to change notification settings - Fork 1
173 lines (151 loc) · 5 KB
/
Copy pathnix.yml
File metadata and controls
173 lines (151 loc) · 5 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Build using `bix` from nixpkgs
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
check:
name: nixpkgs (${{ matrix.system }}, ${{ matrix.toolchain }})
runs-on: ${{ matrix.runner_label }}
outputs:
bitcoin-commit: ${{ steps.bitcoin-commit.outputs.commit }}
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- system: x86_64-linux
runner_label: ubuntu-latest
toolchain: clang
devshell: ./bix
cmake_preset: default
- system: aarch64-linux
runner_label: ubuntu-24.04-arm
toolchain: clang
devshell: ./bix
cmake_preset: default
- system: aarch64-linux
runner_label: ubuntu-24.04-arm
toolchain: clang-strict-align-ubsan
devshell: .#clang-sanitizer
build_name_suffix: strict-align-ubsan
cmake_preset: strict-align-ubsan
- system: aarch64-linux
runner_label: ubuntu-24.04-arm
toolchain: gcc
devshell: .#gcc
cmake_preset: default
- system: aarch64-darwin
runner_label: macos-latest
toolchain: clang
devshell: ./bix
cmake_preset: darwin
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CDASH_BUILD_NAME_PREFIX: nixpkgs
CTEST_CMAKE_GENERATOR: Ninja
steps:
- name: Checkout Nightly Repo
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Checkout Bix Repo
uses: actions/checkout@v6
with:
repository: bitcoin-dev-tools/bix
path: bix
fetch-depth: 1
- name: Checkout Bitcoin Repo
uses: actions/checkout@v6
with:
repository: bitcoin/bitcoin
path: bitcoin
fetch-depth: 1
- name: Get Bitcoin commit hash
id: bitcoin-commit
run: |
BITCOIN_COMMIT=$(cd bitcoin && git rev-parse HEAD)
echo "commit=$BITCOIN_COMMIT" >> $GITHUB_OUTPUT
- name: Cache ccache
uses: actions/cache@v5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.system }}-${{ github.run_id }}
restore-keys: |
ccache-${{ matrix.system }}-
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
extra-conf: |
lazy-trees = true
fallback = true
extra-platforms = x86_64-darwin
- name: Set Up Cachix
uses: cachix/cachix-action@v15
with:
name: nix-dev-shell
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Run `nix flake update`
if: matrix.devshell == './bix'
working-directory: bix
run: nix flake update
- name: Run `nix flake check`
if: matrix.devshell == './bix'
working-directory: bix
run: nix flake check
- name: Build and test
env:
CDASH_BUILD_NAME_SUFFIX: ${{ matrix.build_name_suffix }}
CTEST_CONFIGURE_PRESET: ${{ matrix.cmake_preset }}
run: |
nix develop ${{ matrix.devshell }} --system ${{ matrix.system }} --no-write-lock-file --command bash -c "
set -eux
export CCACHE_DIR=${{ env.CCACHE_DIR }}
ctest --verbose -S ./scripts/build-unit-test.cmake -DCTEST_SOURCE_DIRECTORY=./bitcoin -DCTEST_SITE=${{ github.repository }}
"
vulture:
name: Python dead code (vulture)
runs-on: ubuntu-latest
steps:
- name: Checkout Bitcoin Repo
uses: actions/checkout@v6
with:
repository: bitcoin/bitcoin
fetch-depth: 1
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: false
- name: Run vulture
run: uvx vulture --min-confidence=100 $(git ls-files -- '*.py')
notify-failure:
if: failure() || cancelled()
needs: [check, vulture]
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create failure issue
run: |
BITCOIN_COMMIT="${{ needs.check.outputs.bitcoin-commit }}"
BITCOIN_COMMIT_SHORT="${BITCOIN_COMMIT:0:7}"
gh issue create \
--label "ci-failure" \
--title "Nightly CI Failure - $(date +%Y-%m-%d)" \
--body "**Nightly CI Build Failed**
**Workflow Run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
**This Repo Commit:** ${{ github.sha }}
**Branch:** ${{ github.ref_name }}
**Triggered by:** ${{ github.event_name }}
**Bitcoin Commit:** [\`${BITCOIN_COMMIT_SHORT}\`](https://github.com/bitcoin/bitcoin/commit/${BITCOIN_COMMIT})
cc: @willcl-ark" \
--repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}