CI: Use Nim 2.0 with Atlas #174
This file contains 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: GitHub Actions | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
nim-version: ['1.0.0', '2.0.2'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: "${{ github.event.repository.name }}" | |
- name: Install Choosenim | |
run: | | |
curl -O https://nim-lang.org/choosenim/init.sh | |
sh init.sh -y | |
- name: Add Nim to PATH (linux) | |
if: runner.os == 'Linux' | |
run: echo "/home/runner/.nimble/bin" >> $GITHUB_PATH | |
- name: Add Nim to PATH (windows) | |
if: runner.os == 'Windows' | |
run: | | |
echo "C:\Users\runneradmin\.nimble\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 | |
shell: pwsh | |
- name: Install Atlas | |
run: | | |
git clone https://github.com/nim-lang/atlas.git | |
cd atlas | |
git checkout cbba9fa77fa837931bf3c58e20c1f8cb15a22919 | |
nim c src/atlas.nim | |
- name: Add Atlas to PATH (linux) | |
if: runner.os == 'Linux' | |
run: mv atlas/src/atlas /home/runner/.nimble/bin | |
- name: Add Atlas to PATH (windows) | |
if: runner.os == 'Windows' | |
run: mv atlas/src/atlas.exe C:\Users\runneradmin\.nimble\bin | |
shell: pwsh | |
- name: Init Atlas | |
run: atlas init | |
- name: Install this Commit | |
run: atlas use file://${{ github.event.repository.name }} | |
- name: List nim.cfg | |
run: cat nim.cfg | |
- name: Install Version | |
run: choosenim ${{ matrix.nim-version }} | |
- name: Run tests | |
run: | | |
cd "${{ github.event.repository.name }}" | |
# List test files here | |
nim c -r tests/jstest.nim | |
nim c -r tests/jstest_jsbinny.nim | |
nim c -r tests/test_binny.nim | |
nim c -r tests/test_datetime.nim | |
nim c -r tests/test_flatty.nim | |
nim c -r tests/test_hashy.nim | |
nim c -r tests/test_hexprint.nim | |
nim c -r tests/test_memoryused.nim | |
nim c -r tests/test_objvar.nim | |
nim js -r tests/jstest.nim | |
nim js -r tests/jstest_jsbinny.nim | |
nim js -r tests/test_binny.nim | |
nim js -r tests/test_datetime.nim | |
nim js -r tests/test_flatty.nim | |
nim js -r tests/test_hashy.nim | |
nim js -r tests/test_hexprint.nim | |
nim js -r tests/test_memoryused.nim | |
nim js -r tests/test_objvar.nim |