-
Notifications
You must be signed in to change notification settings - Fork 105
67 lines (55 loc) · 1.83 KB
/
windows-ci.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
# This is a generic workflow for gem Acceptance operations.
name: "Windows Acceptance"
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:
jobs:
acceptance:
name: "acceptance"
runs-on: 'ubuntu-latest'
env:
PUPPET_GEM_VERSION: puppet8-nightly
steps:
- name: "checkout"
uses: "actions/checkout@v4"
- name: "export environment"
run: |
echo "PUPPET_VERSION=puppet8-nightly" >> $GITHUB_ENV
echo "PUPPET_GEM_VERSION=puppet8-nightly" >> $GITHUB_ENV
- name: "setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: '3.2'
bundler-cache: true
- name: "provision machine"
run: |
cat <<EOF > test_machines.json
{
"url": "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID",
"VMs": [
{
"cloud": "gcp",
"images": ["windows-2019"]
}
]
}
EOF
curl -X POST -H "Authorization:bearer $TOKEN" https://facade-main-6f3kfepqcq-uc.a.run.app/v1/provision --data @test_machines.json > ./spec/fixtures/litmus_inventory.yaml
- name: "print inventory"
run: |
cat ./spec/fixtures/litmus_inventory.yaml
- name: "run acceptance"
run: |
function yaml2json() {
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' $*
}
target=$(yaml2json ./spec/fixtures/litmus_inventory.yaml | jq -r '.groups[2].targets[0].uri')
echo $target
TARGET_HOST=$target bundle exec rspec ./spec/acceptance/
# target=$(yaml2json ../inventory.yaml | jq -r '.groups[1].targets[0].uri')
# TARGET_HOST=35.185.225.136 bundle exec rspec ./spec/acceptance/