Skip to content

Commit e63b89f

Browse files
committed
chore: add Appveyor configuration (Windows CI, for WSL)
1 parent 0aa3476 commit e63b89f

9 files changed

+151
-0
lines changed

.appveyor/appveyor.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# build+test under WSL (Windows Subsystem for Linux)
2+
#
3+
# WSL uses a Linux-ish kernel (apparently with modifications to talk to the
4+
# real windows kernel underneath). The Appveyor installation, at least,
5+
# defaults to an Ubuntu 18.04 "Bionic" userspace image, with a handful of
6+
# tools installed (but not build-essential).
7+
8+
# The $PATH includes a bunch of windows directories, with things like Node.js
9+
# (version 8), yarn, Python, ruby, etc. None of which we use; I don't think
10+
# they're part of the normal WSL user's experience.
11+
12+
# Commands added here as " - ps:" are run under PowerShell. Commands which
13+
# are run as " - ps: wsl -- XYZ" get run in a bash environment by the wsl
14+
# tool. In this environment, the exit code of XYZ is ignored (so failing
15+
# programs don't stop the build), but the build will halt with a failure if
16+
# anything is printed to stderr. We use the "./no-stderr" script to make this
17+
# behave more normally. The docs
18+
# (https://www.appveyor.com/docs/build-configuration/#interpreters-and-scripts)
19+
# suggest that putting `$ErrorActionPreference = "Stop";` at "the top of your
20+
# script" (i.e. your PowerShell script) might influence this.
21+
22+
image: Visual Studio 2019
23+
build: off
24+
25+
# the worker clones the repo into the clone folder
26+
# (/mnt/c/projects/agoric-sdk), cds there, then runs each of the following
27+
# steps. Each step is run from /mnt/c/projects/agoric-sdk, even if it uses
28+
# 'cd' internally (i.e. each step is run in a separate shell).
29+
install:
30+
- ps: wsl -- .appveyor/no-stderr .appveyor/install-go.sh
31+
- ps: wsl -- .appveyor/no-stderr .appveyor/install-nvm.sh
32+
- ps: wsl -- .appveyor/no-stderr .appveyor/install-node-13.sh
33+
- ps: wsl -- .appveyor/no-stderr .appveyor/install-yarn.sh
34+
- ps: wsl -- .appveyor/no-stderr .appveyor/install-build-tools.sh
35+
36+
build_script:
37+
- ps: wsl -- .appveyor/no-stderr .appveyor/build.sh
38+
39+
test_script:
40+
- ps: wsl -- .appveyor/no-stderr .appveyor/test.sh

.appveyor/build.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -ie
2+
3+
export PATH="/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4+
5+
echo "pwd is"
6+
pwd
7+
8+
nvm use v13.11.0
9+
echo "running nvm current"
10+
nvm current
11+
12+
yarn
13+
14+
yarn build
15+

.appveyor/install-build-tools.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -ie
2+
3+
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4+
5+
echo "pwd is"
6+
pwd
7+
8+
cd ~
9+
10+
sudo apt update
11+
sudo apt install --yes build-essential make

.appveyor/install-go.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash -ie
2+
3+
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4+
5+
echo "PWD was"
6+
pwd
7+
8+
cd ~
9+
echo "downloading golang installer"
10+
wget -q https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
11+
12+
echo "unpacking tarball"
13+
sudo tar -C /usr/local -xzf go1.14.2.linux-amd64.tar.gz
14+
15+
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
16+
17+
echo "golang unpacked, PATH updated"

.appveyor/install-node-13.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash -ie
2+
3+
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4+
5+
echo "pwd is"
6+
pwd
7+
8+
cd ~
9+
10+
echo "running nvm current"
11+
nvm current
12+
13+
echo "running nvm use v13.11.0"
14+
nvm install v13.11.0
15+
16+
nvm use v13.11.0
17+
18+
echo "running nvm current"
19+
nvm current

.appveyor/install-nvm.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -ie
2+
3+
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4+
5+
echo "pwd is"
6+
pwd
7+
8+
cd ~
9+
10+
echo "downloading NVM install.sh"
11+
wget -q https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh
12+
13+
echo "running NVM install.sh"
14+
bash install.sh
15+
echo "NVM install.sh done" $?

.appveyor/install-yarn.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash -ie
2+
3+
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4+
5+
echo "pwd is"
6+
pwd
7+
8+
cd ~
9+
10+
nvm use v13.11.0
11+
echo "running nvm current"
12+
nvm current
13+
14+
npm install -g yarn

.appveyor/no-stderr

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash -ie
2+
3+
if "$@" 2>&1; then
4+
echo "command succeeded"
5+
else
6+
echo "command failed $?" >&2
7+
fi

.appveyor/test.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash -ie
2+
3+
export PATH="/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4+
5+
echo "pwd is"
6+
pwd
7+
8+
nvm use v13.11.0
9+
echo "running nvm current"
10+
nvm current
11+
12+
yarn test
13+

0 commit comments

Comments
 (0)