@@ -54,18 +54,33 @@ jobs:
5454 builder : ['self-hosted','ubuntu-22.04']
5555 - target :
5656 os : macos
57+ cpu : amd64
5758 builder : macos-13
59+ - target :
60+ os : macos
61+ cpu : arm64
62+ builder : macos-latest
5863 - target :
5964 os : windows
60- builder : windows-2019
65+ builder : windows-2022
6166
6267 defaults :
6368 run :
6469 shell : bash
6570
6671 name : ${{ matrix.target.os }}-${{ matrix.target.cpu }}${{ matrix.branch != '' && ' (Nim ' || '' }}${{ matrix.branch-short }}${{ matrix.branch != '' && ')' || '' }}
6772 runs-on : ${{ matrix.builder }}
73+
6874 steps :
75+ - name : Fix nim cache conflicts
76+ run : |
77+ echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
78+ echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
79+
80+ - name : Clean workspace (very aggressive)
81+ if : contains(matrix.builder, 'self-hosted')
82+ run : rm -rf "$GITHUB_WORKSPACE"/*
83+
6984 - name : Checkout
7085 uses : actions/checkout@v4
7186
@@ -89,23 +104,6 @@ jobs:
89104 7z x -y "external/mingw-${{ matrix.target.cpu }}.zip" -oexternal/mingw-${{ matrix.target.cpu }}/
90105 mv external/mingw-${{ matrix.target.cpu }}/**/* ./external/mingw-${{ matrix.target.cpu }}
91106
92- - name : Restore Nim DLLs dependencies (Windows) from cache
93- if : runner.os == 'Windows'
94- id : windows-dlls-cache
95- uses : actions/cache@v4
96- with :
97- path : external/dlls-${{ matrix.target.cpu }}
98- key : ' dlls-${{ matrix.target.cpu }}'
99-
100- - name : Install DLLs dependencies (Windows)
101- if : >
102- steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
103- runner.os == 'Windows'
104- run : |
105- mkdir -p external
106- curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
107- 7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }}
108-
109107 - name : Path to cached dependencies (Windows)
110108 if : >
111109 runner.os == 'Windows'
@@ -219,32 +217,40 @@ jobs:
219217 name : " Developer builds"
220218 runs-on : ['self-hosted','ubuntu-22.04']
221219 steps :
220+ - name : Fix nim cache conflicts
221+ run : |
222+ echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
223+ echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
224+
225+ - name : Clean workspace (very aggressive)
226+ run : rm -rf "$GITHUB_WORKSPACE"/*
227+
222228 - name : Checkout
223229 uses : actions/checkout@v4
224230 with :
225231 fetch-depth : 1
226232
227- - name : Build with developer flags
228- run : |
229- make -j nimbus_beacon_node LOG_LEVEL=TRACE NIMFLAGS="-d:has_deposit_root_checks=1"
230-
231233 - name : Build files with isMainModule
232234 run : |
233- executables=(
234- "beacon_chain/el/deposit_contract"
235- "beacon_chain/fork_choice/fork_choice"
236- "beacon_chain/fork_choice/proto_array"
237- "beacon_chain/networking/network_metadata_downloads"
238- "beacon_chain/era_db"
239- "beacon_chain/trusted_node_sync"
240- "benchmarks/rest_api_benchmark"
241- "tests/mocking/mock_genesis"
242- )
235+ makefile_content=$(<./Makefile)
236+ executables=()
237+ while IFS= read -r file; do
238+ base=$(basename "$file" ".nim")
239+ if ! grep -qw "$base" <<< "$makefile_content"; then
240+ executables+=("$file")
241+ fi
242+ done < <(grep -Rl --include="*.nim" --exclude-dir=vendor "when isMainModule:" .)
243+ make -j update
243244 source env.sh
244245 for executable in "${executables[@]}"; do
245246 nim c --passC:-fsyntax-only --noLinking:on -d:chronicles_log_level=TRACE "${executable}"
246247 done
247248
249+ - name : Build with custom SECONDS_PER_SLOT
250+ run : |
251+ source env.sh
252+ nim c --passC:-fsyntax-only --noLinking:on -d:chronicles_log_level=TRACE -d:SECONDS_PER_SLOT=1 beacon_chain/nimbus_beacon_node
253+
248254 lint :
249255 name : " Lint"
250256 runs-on : ubuntu-latest
@@ -259,7 +265,7 @@ jobs:
259265 if : ${{ !cancelled() }} && github.event_name == 'pull_request'
260266 run : |
261267 excluded_files="config.yaml|config.nims|beacon_chain.nimble"
262- excluded_extensions="ans|bin|cfg|yml|json|json\\.template|md|png|service|ssz|tpl|txt|lock|nix|gitignore|envrc"
268+ excluded_extensions="ans|bin|cfg|yml|json|json\\.template|md|png|service|ssz|tpl|txt|lock|nix|gitignore|envrc|sh "
263269
264270 current_year=$(date +"%Y")
265271 problematic_files=()
@@ -282,13 +288,13 @@ jobs:
282288 run : |
283289 problematic_files=()
284290 while read -r file; do
285- if ! grep -qE '^{\.push raises: \[\]\.}$' "$file"; then
291+ if ! grep -qE '^{\.push raises: \[\](, gcsafe)? \.}$' "$file"; then
286292 problematic_files+=("$file")
287293 fi
288294 done < <(git diff --name-only --diff-filter=AM --ignore-submodules HEAD^ HEAD | grep -E '\.nim$' || true)
289295
290296 if (( ${#problematic_files[@]} )); then
291- echo "The following files do not have '{.push raises: [].}':"
297+ echo "The following files do not have '{.push raises: [], gcsafe .}' (gcsafe optional) :"
292298 for file in "${problematic_files[@]}"; do
293299 echo "- $file"
294300 done
0 commit comments