Fix tests #1070
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: Build and test the editor | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: ["main", "nim-upgrade"] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "build" | |
| cancel-in-progress: true | |
| jobs: | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| container: ["ubuntu:22.04"] | |
| container: | |
| image: ${{ matrix.container }} | |
| volumes: | |
| - ${{ github.workspace }}:/app | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4.1.7 | |
| - run: apt-get update | |
| continue-on-error: true | |
| - run: apt-get install gcc-mingw-w64 libx11-xcb-dev curl wget build-essential git musl-tools cmake clang -y | |
| continue-on-error: true | |
| - name: Install stable rust toolchain | |
| uses: dtolnay/rust-toolchain@1.81 | |
| - run: rustup target add x86_64-unknown-linux-musl | |
| - uses: iffy/install-nim@v5 | |
| with: | |
| version: nightly:https://github.com/nim-lang/nightlies/releases/tag/2025-10-31-version-2-2-ab00c56904e3126ad826bb520d243513a139436a | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: add project dir as git safe.directory so nimble can install stuff | |
| run: git config --global --add safe.directory /__w/Nev/Nev | |
| continue-on-error: true | |
| - name: Cache nimble modules | |
| id: cache-nimble | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-nimble-modules | |
| with: | |
| path: | | |
| deps | |
| nimcache | |
| emsdk | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('atlas.lock') }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| - if: ${{ steps.cache-nimble.outputs.cache-hit != 'true' }} | |
| name: Download emscripten | |
| run: git clone https://github.com/emscripten-core/emsdk.git | |
| - if: ${{ steps.cache-nimble.outputs.cache-hit != 'true' }} | |
| name: Install emscripten | |
| run: cd emsdk; ./emsdk install 4.0.10; ./emsdk activate 4.0.10; cd .. | |
| - run: echo "${GITHUB_WORKSPACE}/emsdk" >> $GITHUB_PATH | |
| - run: echo "${GITHUB_WORKSPACE}/emsdk/node/22.16.0_64bit/bin" >> $GITHUB_PATH | |
| - run: echo "${GITHUB_WORKSPACE}/emsdk/upstream/emscripten" >> $GITHUB_PATH | |
| - run: nimble install https://github.com/Nimaoth/nimgen@0.5.4 -y | |
| - run: atlas rep | |
| - run: atlas install | |
| - run: PATH=/github/home/.nimble/bin:$PATH nim ./tools/nev_build.nims markdown-parser markdown-plugin debug-linux package-linux --cache=${{steps.cache-nimble.outputs.cache-hit}} | |
| # upload artifacts | |
| - name: Upload release_linux | |
| uses: actions/upload-artifact@v4.3.3 | |
| with: | |
| path: nev-*-x86_64-unknown-linux-*.tar | |
| name: nev-linux | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4.1.7 | |
| # If I want a specific rust version | |
| #- name: Install latest nightly | |
| # uses: actions-rs/toolchain@v1.0.6 | |
| # with: | |
| # toolchain: stable | |
| # override: true | |
| - uses: iffy/install-nim@v5 | |
| with: | |
| version: nightly:https://github.com/nim-lang/nightlies/releases/tag/2025-10-31-version-2-2-ab00c56904e3126ad826bb520d243513a139436a | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache nimble modules | |
| id: cache-nimble | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-nimble-modules-4 | |
| with: | |
| path: | | |
| deps | |
| nimcache | |
| emsdk | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('atlas.lock') }} | |
| - if: ${{ steps.cache-nimble.outputs.cache-hit != 'true' }} | |
| name: Download emscripten | |
| run: git clone https://github.com/emscripten-core/emsdk.git | |
| - if: ${{ steps.cache-nimble.outputs.cache-hit != 'true' }} | |
| name: Install emscripten | |
| run: ./emsdk/emsdk.ps1 install 4.0.10 | |
| - run: nimble install https://github.com/Nimaoth/nimgen@0.5.4 -y | |
| - run: atlas rep | |
| - run: atlas install | |
| # windows builds | |
| - run: ./emsdk/emsdk.ps1 activate 4.0.10; cd plugins/markdown; nim c -d:release --skipParentCfg --passL:"-o markdown.m.wasm" markdown.nim; cd ../.. | |
| - run: nim ./tools/nev_build.nims markdown-parser debug-win package-win --cache=${{steps.cache-nimble.outputs.cache-hit}} | |
| # upload artifacts | |
| - name: Upload release_windows | |
| uses: actions/upload-artifact@v4.3.3 | |
| with: | |
| path: nev-*-x86_64-pc-windows-gnu.zip | |
| name: nev-windows | |
| run-tests: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| container: | |
| image: "ubuntu:22.04" | |
| volumes: | |
| - ${{ github.workspace }}:/app | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4.1.7 | |
| - run: apt-get update | |
| continue-on-error: true | |
| - run: apt-get install gcc-mingw-w64 libx11-xcb-dev curl wget build-essential git musl-tools cmake -y | |
| continue-on-error: true | |
| - name: Install stable rust toolchain | |
| uses: dtolnay/rust-toolchain@1.81 | |
| - uses: iffy/install-nim@v5 | |
| with: | |
| version: nightly:https://github.com/nim-lang/nightlies/releases/tag/2025-10-31-version-2-2-ab00c56904e3126ad826bb520d243513a139436a | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: add project dir as git safe.directory so nimble can install stuff | |
| run: git config --global --add safe.directory /__w/Nev/Nev | |
| continue-on-error: true | |
| - name: Cache nimble modules | |
| id: cache-nimble | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-nimble-modules-5 | |
| with: | |
| path: | | |
| deps | |
| nimcache | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('atlas.lock') }} | |
| - run: nimble install https://github.com/Nimaoth/nimgen@0.5.4 -y | |
| - run: atlas rep | |
| - run: atlas install | |
| - run: "echo 'import wasmtime' > src/temp.nim && nim c -d:nimWasmtimeBuild src/temp.nim" | |
| - name: Run tests | |
| run: testament --print category unit | |
| - name: Build test report | |
| run: testament html | |
| - uses: actions/upload-artifact@v4.3.3 | |
| with: | |
| name: testresults.html | |
| path: testresults.html | |
| # Build job | |
| build-page: | |
| runs-on: ubuntu-latest | |
| needs: run-tests | |
| if: always() | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.1.7 | |
| - uses: actions/download-artifact@v4.1.7 | |
| with: | |
| name: testresults.html | |
| continue-on-error: true | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5.0.0 | |
| - name: Build with Jekyll | |
| uses: actions/jekyll-build-pages@v1.0.12 | |
| with: | |
| source: ./ | |
| destination: ./_site | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3.0.1 | |
| # Deployment job | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build-page | |
| if: github.ref_name == 'main' | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4.0.5 |