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