2024-08-06 16:24:13 +02:00
name : Continuous Integration
2021-07-13 10:26:49 +02:00
on :
push :
branches :
- master
pull_request :
2024-09-10 18:10:24 +02:00
merge_group :
2021-07-13 10:26:49 +02:00
workflow_dispatch :
2020-12-22 18:12:02 -06:00
2022-11-21 16:56:04 +01:00
concurrency :
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress : true
2020-12-22 18:12:02 -06:00
jobs :
2024-08-06 16:24:13 +02:00
test :
2022-01-10 12:29:52 +01:00
timeout-minutes : 90
2020-12-22 18:12:02 -06:00
strategy :
fail-fast : false
matrix :
2024-08-06 16:24:13 +02:00
platform :
2020-12-22 18:12:02 -06:00
- os : linux
cpu : amd64
- os : linux
cpu : i386
2024-08-06 16:24:13 +02:00
- os : linux-gcc-14
2024-08-01 14:50:44 +02:00
cpu : amd64
2020-12-22 18:12:02 -06:00
- os : macos
cpu : amd64
2024-12-21 02:18:56 +01:00
- os : macos-14
cpu : arm64
2020-12-22 18:12:02 -06:00
- os : windows
cpu : amd64
2024-10-31 18:56:13 +01:00
nim :
- ref : version-1-6
2024-08-06 16:24:13 +02:00
memory_management : refc
2024-12-09 15:41:08 -04:00
- ref : version-2-0
2024-08-06 16:24:13 +02:00
memory_management : refc
2020-12-22 18:12:02 -06:00
include :
2024-08-06 16:24:13 +02:00
- platform :
2020-12-22 18:12:02 -06:00
os : linux
2024-07-11 10:22:16 +02:00
builder : ubuntu-22.04
2022-01-10 12:29:52 +01:00
shell : bash
2024-08-06 16:24:13 +02:00
- platform :
os : linux-gcc-14
2024-08-01 14:50:44 +02:00
builder : ubuntu-24.04
shell : bash
2024-08-06 16:24:13 +02:00
- platform :
2020-12-22 18:12:02 -06:00
os : macos
2024-07-11 10:22:16 +02:00
builder : macos-13
2022-01-10 12:29:52 +01:00
shell : bash
2024-12-21 02:18:56 +01:00
- platform :
os : macos-14
builder : macos-14
shell : bash
2024-08-06 16:24:13 +02:00
- platform :
2020-12-22 18:12:02 -06:00
os : windows
2024-07-11 10:22:16 +02:00
builder : windows-2022
2022-01-10 12:29:52 +01:00
shell : msys2 {0}
2021-05-31 22:21:17 +02:00
defaults :
run :
2022-01-10 12:29:52 +01:00
shell : ${{ matrix.shell }}
2021-05-31 22:21:17 +02:00
2024-10-31 18:56:13 +01:00
name : '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.ref }})'
2020-12-22 18:12:02 -06:00
runs-on : ${{ matrix.builder }}
steps :
2022-01-10 12:29:52 +01:00
- name : Checkout
2024-08-06 16:24:13 +02:00
uses : actions/checkout@v4
2020-12-22 18:12:02 -06:00
with :
submodules : true
2021-05-21 10:27:01 -06:00
2022-11-21 16:56:04 +01:00
- name : Setup Nim
uses : "./.github/actions/install_nim"
2022-01-10 12:29:52 +01:00
with :
2024-08-06 16:24:13 +02:00
os : ${{ matrix.platform.os }}
cpu : ${{ matrix.platform.cpu }}
2022-11-21 16:56:04 +01:00
shell : ${{ matrix.shell }}
2024-10-31 18:56:13 +01:00
nim_ref : ${{ matrix.nim.ref }}
2020-12-22 18:12:02 -06:00
- name : Setup Go
2024-08-06 16:24:13 +02:00
uses : actions/setup-go@v5
2020-12-22 18:12:02 -06:00
with :
2024-12-21 02:18:56 +01:00
go-version : '~1.16.0' # That's the minimum Go version that works with arm.
2020-12-22 18:12:02 -06:00
- name : Install p2pd
run : |
2021-09-08 16:58:44 +02:00
V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3
2020-12-22 18:12:02 -06:00
2022-11-21 16:56:04 +01:00
- name : Restore deps from cache
id : deps-cache
uses : actions/cache@v3
with :
path : nimbledeps
2024-10-31 18:56:13 +01:00
# Using nim.ref as a simple way to differentiate between nimble using the "pkgs" or "pkgs2" directories.
2024-12-21 02:18:56 +01:00
# The change happened on Nimble v0.14.0. Also forcing the deps to be reinstalled on each os and cpu.
key : nimbledeps-${{ matrix.nim.ref }}-${{ matrix.builder }}-${{ matrix.platform.cpu }}-${{ hashFiles('.pinned') }} # hashFiles returns a different value on windows
2022-11-21 16:56:04 +01:00
- name : Install deps
if : ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run : |
nimble install_pinned
2024-08-01 14:50:44 +02:00
- name : Use gcc 14
2024-08-06 16:24:13 +02:00
if : ${{ matrix.platform.os == 'linux-gcc-14'}}
2024-08-01 14:50:44 +02:00
run : |
# Add GCC-14 to alternatives
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14
# Set GCC-14 as the default
sudo update-alternatives --set gcc /usr/bin/gcc-14
2022-01-10 12:29:52 +01:00
- name : Run tests
2020-12-22 18:12:02 -06:00
run : |
2022-01-10 12:29:52 +01:00
nim --version
nimble --version
2024-08-01 14:50:44 +02:00
gcc --version
2024-10-31 18:56:13 +01:00
2024-08-06 16:24:13 +02:00
NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}"
2020-12-22 18:12:02 -06:00
nimble test