fixes std/locks
on windows
#3927
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nif ci | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
max-parallel: 20 | |
matrix: | |
branch: [master] | |
target: | |
- os: linux | |
cpu: amd64 | |
nim_branch: devel | |
- os: macos | |
cpu: arm64 | |
nim_branch: devel | |
- os: windows | |
cpu: amd64 | |
nim_branch: devel | |
include: | |
- target: | |
os: linux | |
builder: ubuntu-24.04 | |
- target: | |
os: macos | |
builder: macos-15 | |
- target: | |
os: windows | |
builder: windows-2025 | |
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-nim-${{ matrix.target.nim_branch }} (${{ matrix.branch }})' | |
runs-on: ${{ matrix.builder }} | |
env: | |
NIM_DIR: nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }} | |
NIM_BRANCH: ${{ matrix.target.nim_branch }} | |
NIM_ARCH: ${{ matrix.target.cpu }} | |
steps: | |
- name: set `core.autocrlf` to false | |
run: | | |
git config --global core.autocrlf false | |
git config --global init.defaultBranch master | |
- name: Checkout nif | |
uses: actions/checkout@v4 | |
with: | |
path: nif | |
submodules: false | |
- name: Install Linux dependency (Linux) | |
if: runner.os == 'Linux' | |
shell: bash | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y valgrind gcc-14 g++-14 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 60 --slave /usr/bin/g++ g++ /usr/bin/g++-14 | |
- name: Restore MinGW-W64 (Windows) from cache | |
if: runner.os == 'Windows' | |
id: windows-mingw-cache | |
uses: actions/cache@v4 | |
with: | |
path: external/mingw-${{ matrix.target.cpu }} | |
key: 'mingw-${{ matrix.target.cpu }}' | |
- name: Restore Nim DLLs dependencies (Windows) from cache | |
if: runner.os == 'Windows' | |
id: windows-dlls-cache | |
uses: actions/cache@v4 | |
with: | |
path: external/dlls-${{ matrix.target.cpu }} | |
key: 'dlls-${{ matrix.target.cpu }}' | |
- name: Install MinGW64 dependency (Windows) | |
if: > | |
steps.windows-mingw-cache.outputs.cache-hit != 'true' && | |
runner.os == 'Windows' | |
shell: bash | |
run: | | |
mkdir -p external | |
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then | |
MINGW_URL="https://github.com/brechtsanders/winlibs_mingw/releases/download/11.1.0-12.0.0-9.0.0-r2/winlibs-x86_64-posix-seh-gcc-11.1.0-mingw-w64-9.0.0-r2.7z" | |
ARCH=64 | |
else | |
MINGW_URL="https://github.com/brechtsanders/winlibs_mingw/releases/download/11.1.0-12.0.0-9.0.0-r2/winlibs-i686-posix-dwarf-gcc-11.1.0-mingw-w64-9.0.0-r2.7z" | |
ARCH=32 | |
fi | |
curl -L "$MINGW_URL" -o "external/mingw-${{ matrix.target.cpu }}.7z" | |
7z x -y "external/mingw-${{ matrix.target.cpu }}.7z" -oexternal/ | |
mv external/mingw$ARCH external/mingw-${{ matrix.target.cpu }} | |
- name: Install DLLs dependencies (Windows) | |
if: > | |
steps.windows-dlls-cache.outputs.cache-hit != 'true' && | |
runner.os == 'Windows' | |
shell: bash | |
run: | | |
mkdir -p external | |
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip | |
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }} | |
- name: Path to cached dependencies (Windows) | |
if: > | |
runner.os == 'Windows' | |
shell: bash | |
run: | | |
echo '${{ github.workspace }}'"/external/mingw-${{ matrix.target.cpu }}/bin" >> $GITHUB_PATH | |
echo '${{ github.workspace }}'"/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH | |
#- name: Install winget | |
# if: runner.os == 'Windows' | |
# continue-on-error: true # for some reason errors if latest version already installed | |
# # winget included in windows-2025 and above: | |
# run: winget upgrade winget --accept-package-agreements --accept-source-agreements --disable-interactivity | |
#- name: Install make dependencies with winget (Windows) | |
# if: runner.os == 'Windows' | |
# run: winget install ezwinports.make --disable-interactivity --accept-source-agreements | |
- name: Install make dependencies with chocolatey (Windows) | |
if: runner.os == 'Windows' | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: install make | |
- name: System Info (Windows) | |
if: runner.os == 'Windows' | |
run: "gcc -v" | |
# - name: Restore Nim from cache | |
# if: > | |
# steps.nim-compiler-cache.outputs.cache-hit != 'true' && | |
# matrix.target.nim_branch != 'devel' | |
# id: nim-compiler-cache | |
# uses: actions/cache@v2 | |
# with: | |
# path: '${{ github.workspace }}/nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }}' | |
# key: 'nim-${{ matrix.target.cpu }}-${{ matrix.target.nim_branch }}' | |
- name: Setup Nim | |
uses: alaviss/[email protected] | |
with: | |
path: 'nim' | |
version: ${{ matrix.target.nim_branch }} | |
architecture: ${{ matrix.target.cpu }} | |
- name: Test Building nimony | |
run: | | |
cd nif | |
nim c src/nifler/nifler.nim | |
nim c -r src/nimony/nimony c lib/std/assertions.nim | |
- name: Run tester | |
run: | | |
cd nif | |
nim c -r tests/tester.nim |