Skip to content

Commit 3ccb356

Browse files
authored
use the common CI workflow (#85)
1 parent 92b1c7f commit 3ccb356

File tree

2 files changed

+3
-175
lines changed

2 files changed

+3
-175
lines changed

.github/workflows/ci.yml

+1-173
Original file line numberDiff line numberDiff line change
@@ -6,178 +6,6 @@ on:
66
pull_request:
77
workflow_dispatch:
88

9-
concurrency: # Cancel stale PR builds (but not push builds)
10-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
11-
cancel-in-progress: true
12-
139
jobs:
1410
build:
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
target:
19-
- os: linux
20-
cpu: amd64
21-
- os: linux-gcc-14 # This is to use ubuntu 24 and install gcc 14. Should be removed when ubuntu-latest is 26.04
22-
cpu: amd64
23-
- os: linux
24-
cpu: i386
25-
- os: macos
26-
cpu: amd64
27-
- os: macos
28-
cpu: arm64
29-
- os: windows
30-
cpu: amd64
31-
branch: [version-2-0, version-2-2, devel]
32-
include:
33-
- target:
34-
os: linux
35-
builder: ubuntu-latest
36-
shell: bash
37-
- target:
38-
os: linux-gcc-14 # This is to use ubuntu 24 and install gcc 14. Should be removed when ubuntu-latest is 26.04
39-
builder: ubuntu-24.04
40-
shell: bash
41-
- target:
42-
os: macos
43-
cpu: amd64
44-
builder: macos-13
45-
shell: bash
46-
- target:
47-
os: macos
48-
cpu: arm64
49-
builder: macos-latest
50-
shell: bash
51-
- target:
52-
os: windows
53-
builder: windows-latest
54-
shell: msys2 {0}
55-
56-
defaults:
57-
run:
58-
shell: ${{ matrix.shell }}
59-
60-
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})'
61-
runs-on: ${{ matrix.builder }}
62-
continue-on-error: ${{ matrix.branch == 'devel' }}
63-
steps:
64-
- name: Checkout
65-
uses: actions/checkout@v4
66-
67-
- name: Install build dependencies (Linux i386)
68-
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
69-
run: |
70-
sudo dpkg --add-architecture i386
71-
sudo apt-get update -qq
72-
sudo DEBIAN_FRONTEND='noninteractive' apt-get install \
73-
--no-install-recommends -yq gcc-multilib g++-multilib \
74-
libssl-dev:i386
75-
mkdir -p external/bin
76-
cat << EOF > external/bin/gcc
77-
#!/bin/bash
78-
exec $(which gcc) -m32 "\$@"
79-
EOF
80-
cat << EOF > external/bin/g++
81-
#!/bin/bash
82-
exec $(which g++) -m32 "\$@"
83-
EOF
84-
chmod 755 external/bin/gcc external/bin/g++
85-
echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH
86-
87-
- name: MSYS2 (Windows i386)
88-
if: runner.os == 'Windows' && matrix.target.cpu == 'i386'
89-
uses: msys2/setup-msys2@v2
90-
with:
91-
path-type: inherit
92-
msystem: MINGW32
93-
install: >-
94-
base-devel
95-
git
96-
mingw-w64-i686-toolchain
97-
98-
- name: MSYS2 (Windows amd64)
99-
if: runner.os == 'Windows' && matrix.target.cpu == 'amd64'
100-
uses: msys2/setup-msys2@v2
101-
with:
102-
path-type: inherit
103-
install: >-
104-
base-devel
105-
git
106-
mingw-w64-x86_64-toolchain
107-
108-
- name: Restore Nim DLLs dependencies (Windows) from cache
109-
if: runner.os == 'Windows'
110-
id: windows-dlls-cache
111-
uses: actions/cache@v4
112-
with:
113-
path: external/dlls-${{ matrix.target.cpu }}
114-
key: 'dlls-${{ matrix.target.cpu }}'
115-
116-
- name: Install DLLs dependencies (Windows)
117-
if: >
118-
steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
119-
runner.os == 'Windows'
120-
run: |
121-
mkdir -p external
122-
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
123-
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }}
124-
125-
- name: Path to cached dependencies (Windows)
126-
if: >
127-
runner.os == 'Windows'
128-
run: |
129-
echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH
130-
131-
- name: Derive environment variables
132-
run: |
133-
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
134-
PLATFORM=x64
135-
elif [[ '${{ matrix.target.cpu }}' == 'arm64' ]]; then
136-
PLATFORM=arm64
137-
else
138-
PLATFORM=x86
139-
fi
140-
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
141-
142-
ncpu=
143-
MAKE_CMD="make"
144-
case '${{ runner.os }}' in
145-
'Linux')
146-
ncpu=$(nproc)
147-
;;
148-
'macOS')
149-
ncpu=$(sysctl -n hw.ncpu)
150-
;;
151-
'Windows')
152-
ncpu=$NUMBER_OF_PROCESSORS
153-
MAKE_CMD="mingw32-make"
154-
;;
155-
esac
156-
[[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
157-
echo "ncpu=$ncpu" >> $GITHUB_ENV
158-
echo "MAKE_CMD=${MAKE_CMD}" >> $GITHUB_ENV
159-
160-
- name: Build Nim and Nimble
161-
run: |
162-
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
163-
env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ matrix.branch }} \
164-
QUICK_AND_DIRTY_COMPILER=1 QUICK_AND_DIRTY_NIMBLE=1 CC=gcc \
165-
bash build_nim.sh nim csources dist/nimble NimBinaries
166-
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
167-
168-
- name: Use gcc 14
169-
# Should be removed when ubuntu-latest is 26.04
170-
if : ${{ matrix.target.os == 'linux-gcc-14' }}
171-
run: |
172-
# Add GCC-14 to alternatives
173-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14
174-
# Set GCC-14 as the default
175-
sudo update-alternatives --set gcc /usr/bin/gcc-14
176-
177-
- name: Run tests
178-
run: |
179-
nim --version
180-
nimble --version
181-
gcc --version
182-
nimble install -y --depsOnly
183-
nimble test
11+
uses: status-im/nimbus-common-workflow/.github/workflows/common.yml@main

presto.nimble

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ description = "REST API implementation"
77
license = "MIT"
88
skipDirs = @["tests", "examples"]
99

10-
requires "nim >= 1.6.0",
11-
"chronos ^= 4.0.3",
10+
requires "nim >= 1.6.10",
11+
"chronos >= 4.0.3 & <5.0.0",
1212
"chronicles",
1313
"metrics",
1414
"results",

0 commit comments

Comments
 (0)