Update building_from_source.md #579
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: Build and test the editor | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main", "switch-to-vfs"] | |
# 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/[email protected] | |
- 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/[email protected] | |
- run: rustup target add x86_64-unknown-linux-musl | |
- uses: iffy/install-nim@v5 | |
with: | |
version: binary:2.2.0 | |
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/Absytree/Absytree | |
continue-on-error: true | |
# not working because "source" doesn't exist? | |
#- run: echo "export PATH=/github/home/.nimble/bin:\$PATH" > ~/.profile | |
#- run: source ~/.profile | |
# continue-on-error: true | |
- name: Cache nimble modules | |
id: cache-nimble | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-nimble-modules-6 | |
with: | |
path: ~/.nimble | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('nimble.lock') }} | |
- name: nimble setup | |
continue-on-error: true | |
run: PATH=/github/home/.nimble/bin:$PATH nimble setup | |
# linux builds | |
- run: nim c --out:nev -D:enableGui=false -D:enableTerminal=true --app:console -D:forceLogToFile --passC:-std=gnu11 -d:exposeScriptingApi -D:isCI -D:isCINimbleCached=${{steps.cache-nimble.outputs.cache-hit}} src/desktop_main.nim | |
- run: nim c --out:nevg -D:enableGui=true -D:enableTerminal=false --app:gui -D:forceLogToFile --passC:-std=gnu11 -d:exposeScriptingApi -D:isCI -D:isCINimbleCached=${{steps.cache-nimble.outputs.cache-hit}} src/desktop_main.nim | |
- run: nim c --out:nev-musl -D:enableGui=false -D:enableTerminal=true --app:console -d:musl -d:nimWasmtimeBuildMusl -D:forceLogToFile --passC:-std=gnu11 -d:exposeScriptingApi -D:isCI -D:isCINimbleCached=${{steps.cache-nimble.outputs.cache-hit}} src/desktop_main.nim | |
#- run: PATH=/github/home/.nimble/bin:$PATH nimble buildRemoteWorkspaceHost | |
#- run: PATH=/github/home/.nimble/bin:$PATH nimble buildLspWs | |
# create release packages | |
- run: PATH=/github/home/.nimble/bin:$PATH nim ./tools/package_release.nims -l | |
- run: ls -la release_linux | |
# make zips | |
- name: Zip release_linux | |
uses: vimtor/[email protected] | |
with: | |
files: release_linux | |
dest: release_linux.zip | |
# upload artifacts | |
- name: Upload release_linux | |
uses: actions/[email protected] | |
with: | |
name: release_linux | |
path: release_linux.zip | |
build-windows: | |
name: Build Windows | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout the repo | |
uses: actions/[email protected] | |
# If I want a specific rust version | |
#- name: Install latest nightly | |
# uses: actions-rs/[email protected] | |
# with: | |
# toolchain: stable | |
# override: true | |
- uses: iffy/install-nim@v5 | |
with: | |
version: binary:2.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache nimble modules | |
id: cache-nimble | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-nimble-modules-2 | |
with: | |
path: ~/.nimble | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('nimble.lock') }} | |
- if: ${{ steps.cache-nimble.outputs.cache-hit != 'true' }} | |
name: nimble setup | |
continue-on-error: true | |
run: nimble setup | |
- name: nimble setup | |
continue-on-error: true | |
run: nimble setup | |
# windows builds | |
- run: nim c --out:nev.exe -D:enableGui=false -D:enableTerminal=true --app:console -D:forceLogToFile --passC:-std=gnu11 -d:exposeScriptingApi -D:isCI -D:isCINimbleCached=${{steps.cache-nimble.outputs.cache-hit}} src/desktop_main.nim | |
- run: nim c --out:nevg.exe -D:enableGui=true -D:enableTerminal=false --app:gui -D:forceLogToFile --passC:-std=gnu11 -d:exposeScriptingApi -D:isCI -D:isCINimbleCached=${{steps.cache-nimble.outputs.cache-hit}} src/desktop_main.nim | |
#- run: nimble buildRemoteWorkspaceHostWindows | |
#- run: nimble buildLspWsWindows | |
# create release packages | |
- run: nim ./tools/package_release.nims -w | |
# make zips | |
- name: Zip release_windows | |
uses: vimtor/[email protected] | |
with: | |
files: release_windows | |
dest: release_windows.zip | |
# upload artifacts | |
- name: Upload release_windows | |
uses: actions/[email protected] | |
with: | |
name: release_windows | |
path: release_windows.zip | |
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/[email protected] | |
- 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/[email protected] | |
- uses: iffy/install-nim@v5 | |
with: | |
version: binary:2.2.0 | |
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/Absytree/Absytree | |
continue-on-error: true | |
- name: Cache nimble modules | |
id: cache-nimble | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-nimble-modules-4 | |
with: | |
path: ~/.nimble | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('nimble.lock') }} | |
- name: nimble setup | |
continue-on-error: true | |
run: PATH=/github/home/.nimble/bin:$PATH nimble setup | |
- run: "echo 'import nimwasmtime' > src/temp.nim && nim c -d:nimWasmtimeBuild src/temp.nim" | |
- name: Run tests | |
continue-on-error: true | |
run: testament --print category unit | |
- name: Build test report | |
run: testament html | |
- uses: actions/[email protected] | |
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/[email protected] | |
- uses: actions/[email protected] | |
with: | |
name: testresults.html | |
continue-on-error: true | |
- name: Setup Pages | |
uses: actions/[email protected] | |
- name: Build with Jekyll | |
uses: actions/[email protected] | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/[email protected] | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build-page | |
if: always() | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/[email protected] |