-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.39 KB
/
test.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: "Acceptance Testing"
on: [pull_request]
jobs:
Testing:
name: "Node ${{ matrix.node_version }} - ${{ matrix.platform }}"
runs-on: macos-10.15
strategy:
fail-fast: false
matrix:
node_version:
- 15
platform:
- generic/centos7
- generic/debian9
env:
PLATFORM: ${{ matrix.platform }}
VM_PROVIDER: virtualbox
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Cache Node
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: ${{ matrix.node_version }}
- name: Cache Vagrant boxes
uses: actions/cache@v2
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-
- name: Download Vagrant box
run: |
cd /Users/runner/work/small-cloud/small-cloud/tools && npm install
isLocal=$(/Users/runner/work/small-cloud/small-cloud/tools/node_modules/.bin/ts-node check_local.ts ${{ matrix.platform }})
if [[ "$isLocal" == "true" ]]; then
echo "${{ matrix.platform }} already downloaded!"
else
if [[ "$isLocal" == "unsupported" ]]; then
echo "${{ matrix.platform }} is not supported in this version!"
exit 1
else
vagrant box add --name ${{ matrix.platform }} $isLocal
fi
fi
- name: Cache Puppet
id: cache-puppet
uses: actions/cache@v2
with:
path: ~/.puppetlabs/opt/puppet/cache
key: ${{ runner.os }}-puppetlabs-
- name: Install Puppet Agent
run: brew install cask puppetlabs/puppet/puppet-agent
# - name: Start SSH session
# if: matrix.platform == 'generic/centos7'
# uses: luchihoratiu/debug-via-ssh@main
# with:
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
# SSH_PASS: ${{ secrets.SSH_PASS }}
- name: Run test
run: |
sudo chmod 0666 /etc/hosts
npm install
npm run test:acceptance