-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (39 loc) · 1.33 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install and configure LXD
env:
runTests: true
LXD_SECRET: testing
run: |
echo >&2 "$(printenv)"
export PATH=./node_modules/.bin:/usr/bin:/bin:/snap/bin:$PATH
set -eo pipefail
sudo apt-get -y remove lxd lxd-client
#sudo groupadd --system lxd
sudo usermod -a -G lxd $USER
sudo apt-get --yes install snapd
sudo snap install lxd
sudo ln -s /snap/bin/lxc /usr/bin/lxc
sudo lxd waitready
sudo lxd init --auto --network-address="127.0.0.1" --storage-backend=dir --trust-password=$LXD_SECRET
openssl genrsa 2048 > client.key
openssl req -new -x509 -nodes -sha1 -days 365 -key client.key -out client.crt -subj "/C=GB/ST=London/L=London/O=TEST/OU=IT Department/CN=lxd.localhost"
sudo lxd.lxc config trust add client.crt
curl -s -k -L --cert client.crt --key client.key "https://127.0.0.1:8443/1.0"
- name: Set Node.js 10.x
uses: actions/setup-node@master
with:
node-version: 10.x
- name: Install dependencies
working-directory: ./
run: |
npm install
- name: Run tests
working-directory: ./
run: |
npm run test