Skip to content

Update main.yml

Update main.yml #745

Workflow file for this run

name: Build and test the editor
on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "test/build-wasm-in-ci"]
# 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 -y
continue-on-error: true
- name: Install stable rust toolchain
uses: dtolnay/rust-toolchain@1.78
- 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
emsdk
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('nimble.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 latest; ./emsdk activate latest; 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
- name: nimble setup
continue-on-error: true
run: PATH=/github/home/.nimble/bin:$PATH nimble setup
# linux builds
- run: nimble buildNimConfigWasmAll
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: 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-3
with:
path: |
~/.nimble
emsdk
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('nimble.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 latest
- 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: ./emsdk/emsdk.ps1 activate latest; nimble buildNimConfigWasmAll