nim-libp2p/.github/workflows/ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

120 lines
3.3 KiB
YAML
Raw Normal View History

name: Continuous Integration
on:
push:
branches:
- master
pull_request:
merge_group:
workflow_dispatch:
2022-11-21 15:56:04 +00:00
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
platform:
- os: linux
cpu: amd64
- os: linux
cpu: i386
- os: linux-gcc-14
cpu: amd64
- 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
- os: windows
cpu: amd64
nim:
- branch: version-1-6
memory_management: refc
- branch: version-2-0
memory_management: refc
include:
- platform:
os: linux
builder: ubuntu-22.04
shell: bash
- platform:
os: linux-gcc-14
builder: ubuntu-24.04
shell: bash
- platform:
os: macos
builder: macos-13
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
- platform:
os: windows
builder: windows-2022
shell: msys2 {0}
defaults:
run:
shell: ${{ matrix.shell }}
name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})'
runs-on: ${{ matrix.builder }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
2022-11-21 15:56:04 +00:00
- name: Setup Nim
uses: "./.github/actions/install_nim"
with:
os: ${{ matrix.platform.os }}
cpu: ${{ matrix.platform.cpu }}
2022-11-21 15:56:04 +00:00
shell: ${{ matrix.shell }}
nim_branch: ${{ matrix.nim.branch }}
- name: Setup Go
uses: actions/setup-go@v5
with:
2024-10-10 15:24:52 +00:00
go-version: '~1.16.0' # That's the minimum Go version that works with arm.
- name: Install p2pd
run: |
V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3
2022-11-21 15:56:04 +00:00
- name: Restore deps from cache
id: deps-cache
uses: actions/cache@v3
with:
path: nimbledeps
# Using nim.branch as a simple way to differentiate between nimble using the "pkgs" or "pkgs2" directories.
# 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
- name: Use gcc 14
if : ${{ matrix.platform.os == 'linux-gcc-14'}}
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
- name: Run tests
run: |
nim --version
nimble --version
gcc --version
NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}"
nimble test