Skip to content

Build & Test WSL

Build & Test WSL #21

Workflow file for this run

name: Build & Test WSL
on:
push:
tags:
- '*'
branches:
- 'public/build/**wsl**'
workflow_dispatch:
# Allow to run manually
jobs:
windows:
runs-on: windows-latest
name: Ubuntu 20.04
# Following https://github.com/sagemath/sage/issues/25206#comment:63
steps:
- name: Configure git
run: git config --global core.symlinks true
- uses: actions/checkout@v3
- name: Install Ubuntu 20.04 (in WSL)
run: |
(New-Object System.Net.WebClient).DownloadFile("https://aka.ms/wslubuntu2004", "Ubuntu.appx")
Expand-Archive Ubuntu.appx
Ubuntu\ubuntu2004.exe install --root
- name: Install dependencies
run: |
wsl sudo apt-get update -y
wsl sudo apt-get install -y tox
- name: Build
run: wsl tox -e local-sudo-ubuntu-standard -- SAGE_NUM_THREADS=4 build
env:
# WSL runs everything as root, so we have to enable build as root user
EXTRA_CONFIGURE_ARGS: "--enable-build-as-root"
# If make is invoked in parellel (i.e. with -jN where N > 1), then we sometimes run into errors for some reason
# So keep N small in order to minimize the risk
MAKE: "make -j2"
WSLENV: EXTRA_CONFIGURE_ARGS:MAKE
- name: Test
run: wsl tox -e local-sudo-ubuntu-standard -- SAGE_NUM_THREADS=4 ptest
- name: Prepare logs artifact
run: mkdir -p "artifacts/logs"; cp -r .tox/*/log "artifacts/logs"
shell: bash
if: always()
- uses: actions/upload-artifact@v3
with:
path: artifacts
name: logs
if: always()
- name: Print out logs for immediate inspection
# and markup the output with GitHub Actions logging commands
run: .github/workflows/scan-logs.sh "artifacts/logs"
shell: bash
if: always()