2024-01-27 13:34:11 +00:00
|
|
|
# Nimbus
|
|
|
|
# Copyright (c) 2021-2024 Status Research & Development GmbH
|
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
|
|
|
|
# http://opensource.org/licenses/MIT)
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except
|
|
|
|
# according to those terms.
|
|
|
|
|
2022-04-20 13:24:24 +00:00
|
|
|
name: Simulators
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# every two days 11 PM
|
|
|
|
- cron: "0 23 */2 * *"
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-linux-amd64:
|
|
|
|
name: Linux-amd64
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Get latest nimbus-build-system commit hash
|
|
|
|
id: versions
|
|
|
|
run: |
|
|
|
|
sudo apt-get -q update
|
|
|
|
getHash() {
|
|
|
|
git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
|
|
|
|
}
|
|
|
|
nbsHash=$(getHash status-im/nimbus-build-system)
|
2022-12-08 05:32:40 +00:00
|
|
|
echo "nimbus_build_system=$nbsHash" >> $GITHUB_OUTPUT
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Restore prebuilt Nim from cache
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/cache@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
path: NimBinaries
|
2023-09-14 05:25:23 +00:00
|
|
|
key: 'nim-linux-amd64-${{ steps.versions.outputs.nimbus_build_system }}-sim'
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Build Nim and deps
|
|
|
|
run: |
|
|
|
|
ncpu=$(nproc)
|
2023-09-19 00:47:58 +00:00
|
|
|
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
|
2024-10-29 07:16:14 +00:00
|
|
|
make -j${ncpu} deps rocksdb
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Run Simulators
|
|
|
|
run: |
|
|
|
|
SIM_SCRIPT="hive_integration/nodocker/build_sims.sh"
|
|
|
|
chmod +x ${SIM_SCRIPT}
|
|
|
|
${SIM_SCRIPT} "Linux-amd64"
|
|
|
|
|
|
|
|
- name: Upload artefact
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
name: linux_amd64_stat
|
|
|
|
path: ./simulators.md
|
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
build-macos-amd64:
|
|
|
|
name: Macos-amd64
|
2024-10-26 06:37:29 +00:00
|
|
|
runs-on: macos-13
|
2022-04-20 13:24:24 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Get latest nimbus-build-system commit hash
|
|
|
|
id: versions
|
|
|
|
run: |
|
|
|
|
getHash() {
|
|
|
|
git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
|
|
|
|
}
|
|
|
|
nbsHash=$(getHash status-im/nimbus-build-system)
|
2022-12-08 05:32:40 +00:00
|
|
|
echo "nimbus_build_system=$nbsHash" >> $GITHUB_OUTPUT
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Restore prebuilt Nim from cache
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/cache@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
path: NimBinaries
|
2023-09-14 05:25:23 +00:00
|
|
|
key: 'nim-macos-amd64-${{ steps.versions.outputs.nimbus_build_system }}-sim'
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Build Nim and deps
|
|
|
|
run: |
|
|
|
|
ncpu=$(sysctl -n hw.ncpu)
|
2023-09-19 00:47:58 +00:00
|
|
|
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
|
2024-10-29 07:16:14 +00:00
|
|
|
make -j${ncpu} deps rocksdb
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Run Simulators
|
|
|
|
run: |
|
|
|
|
SIM_SCRIPT="hive_integration/nodocker/build_sims.sh"
|
|
|
|
chmod +x ${SIM_SCRIPT}
|
|
|
|
${SIM_SCRIPT} "MacOS-amd64"
|
|
|
|
|
|
|
|
- name: Upload artefact
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
name: macos_amd64_stat
|
|
|
|
path: ./simulators.md
|
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
build-windows-amd64:
|
|
|
|
name: Windows-amd64
|
|
|
|
runs-on: windows-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
2023-09-08 15:10:16 +00:00
|
|
|
shell: bash
|
2022-04-20 13:24:24 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
|
2024-02-04 14:28:20 +00:00
|
|
|
- name: Restore Nim DLLs dependencies from cache
|
|
|
|
id: windows-dlls-cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: external/dlls
|
|
|
|
# according to docu, idle caches are kept for up to 7 days
|
|
|
|
# so change dlls# to force new cache contents (for some number #)
|
2024-06-04 16:15:33 +00:00
|
|
|
key: dlls1
|
2024-02-04 14:28:20 +00:00
|
|
|
|
|
|
|
- name: Install DLLs dependencies
|
|
|
|
if: steps.windows-dlls-cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
DLLPATH=external/dlls
|
|
|
|
mkdir -p external
|
|
|
|
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
|
|
|
|
7z x -y external/windeps.zip -o"$DLLPATH"
|
|
|
|
|
|
|
|
- name: Restore llvm-mingw from cache
|
2023-09-08 15:10:16 +00:00
|
|
|
id: windows-mingw-cache
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/cache@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
2023-09-08 15:10:16 +00:00
|
|
|
path: external/mingw-amd64
|
2023-09-10 14:13:09 +00:00
|
|
|
key: 'mingw-llvm-17-sim'
|
2023-09-08 15:10:16 +00:00
|
|
|
|
2024-02-04 14:28:20 +00:00
|
|
|
- name: Install llvm-mingw dependency
|
|
|
|
if: steps.windows-mingw-cache.outputs.cache-hit != 'true'
|
2023-09-08 15:10:16 +00:00
|
|
|
run: |
|
|
|
|
mkdir -p external
|
|
|
|
MINGW_BASE="https://github.com/mstorsjo/llvm-mingw/releases/download/20230905"
|
|
|
|
MINGW_URL="$MINGW_BASE/llvm-mingw-20230905-ucrt-x86_64.zip"
|
|
|
|
curl -L "$MINGW_URL" -o "external/mingw-amd64.zip"
|
|
|
|
7z x -y "external/mingw-amd64.zip" -oexternal/mingw-amd64/
|
|
|
|
mv external/mingw-amd64/**/* ./external/mingw-amd64
|
2023-09-14 03:23:15 +00:00
|
|
|
|
2024-02-04 14:28:20 +00:00
|
|
|
- name: Path to cached dependencies
|
2023-09-14 03:23:15 +00:00
|
|
|
run: |
|
2023-09-08 15:10:16 +00:00
|
|
|
echo '${{ github.workspace }}'"/external/mingw-amd64/bin" >> $GITHUB_PATH
|
2024-02-04 14:28:20 +00:00
|
|
|
echo '${{ github.workspace }}'"/external/dlls" >> $GITHUB_PATH
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Get latest nimbus-build-system commit hash
|
|
|
|
id: versions
|
|
|
|
run: |
|
|
|
|
getHash() {
|
|
|
|
git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
|
|
|
|
}
|
|
|
|
nbsHash=$(getHash status-im/nimbus-build-system)
|
2022-12-08 05:32:40 +00:00
|
|
|
echo "nimbus_build_system=$nbsHash" >> $GITHUB_OUTPUT
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Restore prebuilt Nim from cache
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/cache@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
path: NimBinaries
|
2023-09-14 05:25:23 +00:00
|
|
|
key: 'nim-windows-amd64-${{ steps.versions.outputs.nimbus_build_system }}-sim'
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Build Nim and deps
|
|
|
|
run: |
|
|
|
|
ncpu=${NUMBER_OF_PROCESSORS}
|
2023-09-19 00:47:58 +00:00
|
|
|
mingw32-make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
|
2022-04-20 13:24:24 +00:00
|
|
|
mingw32-make -j${ncpu} deps
|
|
|
|
|
|
|
|
- name: Run Simulators
|
|
|
|
run: |
|
|
|
|
SIM_SCRIPT="hive_integration/nodocker/build_sims.sh"
|
|
|
|
${SIM_SCRIPT} "Windows-amd64"
|
|
|
|
|
|
|
|
- name: Upload artefact
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
name: windows_amd64_stat
|
|
|
|
path: ./simulators.md
|
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
prepare-stat:
|
|
|
|
name: Test results
|
|
|
|
needs: [build-linux-amd64, build-macos-amd64, build-windows-amd64]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
|
|
|
|
- name: Download artefacts
|
2024-01-27 13:34:11 +00:00
|
|
|
uses: actions/download-artifact@v4
|
2022-04-20 13:24:24 +00:00
|
|
|
|
2023-02-23 13:17:15 +00:00
|
|
|
- name: Create statistics notes
|
|
|
|
run: |
|
|
|
|
cat linux_amd64_stat/* > stat_notes.md
|
|
|
|
cat macos_amd64_stat/* >> stat_notes.md
|
|
|
|
cat windows_amd64_stat/* >> stat_notes.md
|
|
|
|
|
2022-04-20 13:24:24 +00:00
|
|
|
- name: Delete tag
|
2023-06-25 13:30:34 +00:00
|
|
|
uses: dev-drprasad/delete-tag-and-release@v1.0.1
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
delete_release: true
|
|
|
|
tag_name: sim-stat
|
2023-06-27 00:40:01 +00:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Simulators results
|
2023-02-23 13:17:15 +00:00
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
allowUpdates: true
|
|
|
|
prerelease: true
|
|
|
|
commit: master
|
|
|
|
name: "Simulators results"
|
|
|
|
tag: sim-stat
|
|
|
|
bodyFile: "stat_notes.md"
|
2022-04-20 13:24:24 +00:00
|
|
|
|
|
|
|
- name: Delete artefacts
|
2022-12-08 05:32:40 +00:00
|
|
|
uses: geekyeggo/delete-artifact@v2
|
2022-04-20 13:24:24 +00:00
|
|
|
with:
|
|
|
|
failOnError: false
|
|
|
|
name: |
|
|
|
|
linux_amd64_stat
|
|
|
|
macos_amd64_stat
|
|
|
|
windows_amd64_stat
|