Skip to content

Commit

Permalink
Trac #30216: GH Actions: Test Windows with WSL
Browse files Browse the repository at this point in the history
https://groups.google.com/d/msg/sage-devel/vC0ySd4HGeQ/RBA_XrqLBAAJ

URL: https://trac.sagemath.org/30216
Reported by: mkoeppe
Ticket author(s): Tobias Diez
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed Sep 15, 2020
2 parents 762de29 + e8a984b commit 57cd152
Show file tree
Hide file tree
Showing 19 changed files with 113 additions and 22 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci-wsl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build & Test WSL

on: [push, pull_request]

jobs:
windows:
runs-on: windows-latest
name: Windows (using WSL)
# Following https://trac.sagemath.org/ticket/25206#comment:63
steps:
- name: Configure git
run: git config --global core.symlinks true
- uses: actions/checkout@v2
- 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: |
Function ExtractPackages
{
param($path)
@(Get-Content $path | Where-Object { !$_.StartsWith("#") })
}
$packages = Get-ChildItem build/pkgs -recurse -Include debian.txt, debian-bootstrap.txt | foreach-object { ExtractPackages $_.FullName } | sort -Unique
# Add tox which is use to build
$packages += 'tox'
echo "Install the following packages:" @packages
# Add deadsnakes so that libpython3.7-dev is found
& wsl sudo add-apt-repository ppa:deadsnakes/ppa
# Install
& wsl sudo apt-get update -y
& wsl sudo apt-get install -y @packages
- name: Build
run: wsl tox -e local -- 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 -- 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@v1
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()
8 changes: 4 additions & 4 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ install_config_rpath() {
echo >&2 "your PATH. E.g. Homebrew installs them in /usr/local/opt/gettext/bin."
return 179
fi
eval `sed -n '/^prefix=.*$/p' $gettextize`
eval `sed -n '/^datarootdir=.*$/p' $gettextize`
eval `sed -n '/^: \${gettext_datadir=.*$/p' $gettextize`
eval `sed -n '/^prefix=.*$/p' "$gettextize"`
eval `sed -n '/^datarootdir=.*$/p' "$gettextize"`
eval `sed -n '/^: \${gettext_datadir=.*$/p' "$gettextize"`

if [ -z "$gettext_datadir" ]; then
eval `sed -n '/^gettext_dir=.*$/p' $gettextize`
eval `sed -n '/^gettext_dir=.*$/p' "$gettextize"`
# In older versions (before 2014) this is spelled gettext_dir
# See https://github.com/autotools-mirror/gettext/commit/ff18897068486560e2bb421004cfbd42b7cdd0f8
gettext_datadir="$gettext_dir"
Expand Down
3 changes: 2 additions & 1 deletion build/pkgs/brial/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
libbrial-dev libbrial-groebner-dev
libbrial-dev
libbrial-groebner-dev
3 changes: 2 additions & 1 deletion build/pkgs/cddlib/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
libcdd-dev libcdd-tools
libcdd-dev
libcdd-tools
3 changes: 2 additions & 1 deletion build/pkgs/cliquer/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cliquer libcliquer-dev
cliquer
libcliquer-dev
3 changes: 2 additions & 1 deletion build/pkgs/curl/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
curl libcurl4-openssl-dev
curl
libcurl4-openssl-dev
6 changes: 5 additions & 1 deletion build/pkgs/debian-bootstrap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Packages needed for ./bootstrap
gettext autoconf automake libtool pkg-config
gettext
autoconf
automake
libtool
pkg-config
3 changes: 2 additions & 1 deletion build/pkgs/debian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ make
m4
perl
# python3-minimal is not enough on debian buster, ubuntu bionic - it does not have urllib
python3 # system python for bootstrapping the build
# system python for bootstrapping the build
python3
tar
bc
gcc
Expand Down
3 changes: 2 additions & 1 deletion build/pkgs/ecm/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
gmp-ecm libecm-dev
gmp-ecm
libecm-dev
3 changes: 2 additions & 1 deletion build/pkgs/gcc/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
gcc g++
gcc
g++
3 changes: 2 additions & 1 deletion build/pkgs/glpk/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
glpk-utils libglpk-dev
glpk-utils
libglpk-dev
3 changes: 2 additions & 1 deletion build/pkgs/lcalc/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
lcalc liblfunction-dev
lcalc
liblfunction-dev
3 changes: 2 additions & 1 deletion build/pkgs/openssl/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
openssl libssl-dev
openssl
libssl-dev
8 changes: 6 additions & 2 deletions build/pkgs/pari/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
pari-gp2c libpari-dev
pari-gp2c
libpari-dev
# #29319: cypari2 needs gphelp at installation time
pari-doc
# We add these data packages because they are checked by spkg-configure.m4
pari-elldata pari-galdata pari-galpol pari-seadata
pari-elldata
pari-galdata
pari-galpol
pari-seadata
11 changes: 10 additions & 1 deletion build/pkgs/perl_cpan_polymake_prereq/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
libxml-libxslt-perl libxml-writer-perl libxml2-dev libperl-dev libfile-slurp-perl libjson-perl libsvg-perl libterm-readkey-perl libterm-readline-gnu-perl libmongodb-perl
libxml-libxslt-perl
libxml-writer-perl
libxml2-dev
libperl-dev
libfile-slurp-perl
libjson-perl
libsvg-perl
libterm-readkey-perl
libterm-readline-gnu-perl
libmongodb-perl
3 changes: 2 additions & 1 deletion build/pkgs/planarity/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
libplanarity-dev planarity
libplanarity-dev
planarity
4 changes: 3 additions & 1 deletion build/pkgs/python3/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
python3 libpython3-dev python3-distutils
python3
libpython3-dev
python3-distutils
3 changes: 2 additions & 1 deletion build/pkgs/r/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
r-base-dev
r-cran-lattice # 29471
# 29471
r-cran-lattice
3 changes: 2 additions & 1 deletion build/pkgs/xz/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
xz-utils liblzma-dev
xz-utils
liblzma-dev
# pixz # provides pixz but not xz on debian buster

0 comments on commit 57cd152

Please sign in to comment.