update ci.yml to test Nim 2.2; also test gcc-14 (#60)

This commit is contained in:
Miran 2024-09-11 16:15:17 +02:00 committed by GitHub
parent 4470f49bcd
commit 641902d492
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 10 deletions

View File

@ -18,27 +18,39 @@ jobs:
target: target:
- os: linux - os: linux
cpu: amd64 cpu: amd64
- os: linux-gcc-14 # This is to use ubuntu 24 and install gcc 14. Should be removed when ubuntu-latest is 26.04
cpu: amd64
- os: linux - os: linux
cpu: i386 cpu: i386
- os: macos - os: macos
cpu: amd64 cpu: amd64
- os: macos
cpu: arm64
- os: windows - os: windows
cpu: amd64 cpu: amd64
#- os: windows branch: [version-2-0, version-2-2, devel]
#cpu: i386
branch: [version-1-6, version-2-0, devel]
include: include:
- target: - target:
os: linux os: linux
builder: ubuntu-20.04 builder: ubuntu-latest
shell: bash
- target:
os: linux-gcc-14 # This is to use ubuntu 24 and install gcc 14. Should be removed when ubuntu-latest is 26.04
builder: ubuntu-24.04
shell: bash shell: bash
- target: - target:
os: macos os: macos
builder: macos-12 cpu: amd64
builder: macos-13
shell: bash
- target:
os: macos
cpu: arm64
builder: macos-latest
shell: bash shell: bash
- target: - target:
os: windows os: windows
builder: windows-2019 builder: windows-latest
shell: msys2 {0} shell: msys2 {0}
defaults: defaults:
@ -50,7 +62,7 @@ jobs:
continue-on-error: ${{ matrix.branch == 'devel' }} continue-on-error: ${{ matrix.branch == 'devel' }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
@ -98,7 +110,7 @@ jobs:
- name: Restore Nim DLLs dependencies (Windows) from cache - name: Restore Nim DLLs dependencies (Windows) from cache
if: runner.os == 'Windows' if: runner.os == 'Windows'
id: windows-dlls-cache id: windows-dlls-cache
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: external/dlls-${{ matrix.target.cpu }} path: external/dlls-${{ matrix.target.cpu }}
key: 'dlls-${{ matrix.target.cpu }}' key: 'dlls-${{ matrix.target.cpu }}'
@ -122,6 +134,8 @@ jobs:
run: | run: |
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
PLATFORM=x64 PLATFORM=x64
elif [[ '${{ matrix.target.cpu }}' == 'arm64' ]]; then
PLATFORM=arm64
else else
PLATFORM=x86 PLATFORM=x86
fi fi
@ -153,10 +167,20 @@ jobs:
bash build_nim.sh nim csources dist/nimble NimBinaries bash build_nim.sh nim csources dist/nimble NimBinaries
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
- name: Use gcc 14
# Should be removed when ubuntu-latest is 26.04
if : ${{ matrix.target.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 - name: Run tests
run: | run: |
nim --version nim --version
nimble --version nimble --version
gcc --version
nimble install -y --depsOnly nimble install -y --depsOnly
rm -f nimble.lock rm -f nimble.lock
env NIMLANG=c nimble test env NIMLANG=c nimble test

View File

@ -26,9 +26,9 @@ proc build(args, path: string) =
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
proc run(args, path: string) = proc run(args, path: string) =
build args & " -r", path
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:refc -r", path build args & " --mm:refc -r", path
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:orc -r", path
task test, "Tests": task test, "Tests":
run "--threads:on", "tests/all_tests" run "--threads:on", "tests/all_tests"