-
Notifications
You must be signed in to change notification settings - Fork 54
130 lines (117 loc) · 3.95 KB
/
base_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Base Tests
on:
push:
branches:
- master
pull_request:
workflow_call:
inputs:
include:
description: 'Include matrix configurations'
required: false
type: string
default: "[]"
exclude:
description: 'Exclude matrix configurations'
required: false
type: string
default: "[]"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
delete_cache:
name: Delete github action's branch cache
runs-on: ubuntu-latest
steps:
- uses: snnaplab/delete-branch-cache-action@v1
test:
needs: delete_cache
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
platform:
- os: linux
builder: ubuntu-22.04
cpu: amd64
shell: bash
- os: linux
builder: ubuntu-22.04
cpu: i386
shell: bash
- os: macos
builder: macos-13
cpu: amd64
shell: bash
- os: windows
builder: windows-2022
cpu: amd64
shell: msys2 {0}
nim_branch:
- version: version-1-6
memory_management: refc
- version: version-2-0
memory_management: refc
# - version: devel
# memory_management: orc
# If exclude or include are defined use their value, otherwise default to empty list (as declared on workflow_call.inputs).
# Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string).
# This relies on the value 0 meaning the parameter was not filled in.
include: ${{ inputs.include != 0 && fromJSON(inputs.include) || fromJSON('[]') }}
exclude: ${{ inputs.exclude != 0 && fromJSON(inputs.exclude) || fromJSON('[]') }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})'
runs-on: ${{ matrix.platform.builder }}
continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Nim
uses: "./.github/actions/install_nim"
with:
os: ${{ matrix.platform.os }}
shell: ${{ matrix.platform.shell }}
nim_branch: ${{ matrix.nim_branch.version }}
cpu: ${{ matrix.platform.cpu }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.15.5'
cache: false
- name: Install p2pd
run: |
V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3
- name: Install deps
run: |
nimble install -y --depsOnly
- name: Run tests
run: |
nim --version
nimble --version
NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim_branch.memory_management }}"
nimble test
# lint:
# name: "Lint"
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base
# - name: Check nph formatting
# # Pin nph to a specific version to avoid sudden style differences.
# # Updating nph version should be accompanied with running the new
# # version on the fluffy directory.
# run: |
# VERSION="v0.5.1"
# ARCHIVE="nph-linux_x64.tar.gz"
# curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE}
# tar -xzf ${ARCHIVE}
# shopt -s extglob # Enable extended globbing
# ./nph examples libp2p tests tools *.@(nim|nims|nimble)
# git diff --exit-code