(CAT-1940) Move Windows testing onto the GCP #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: "test" | |
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-release-6f3kfepqcq-ew.a.run.app/v1/provision --data @test_machines.json > inventory.yaml | |
- name: "print inventory" | |
run: | | |
cat ./inventory.yaml | |
- name: "run acceptance" | |
run: | | |
function yaml2json() { | |
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' $* | |
} | |
echo "Target Machine: $(yaml2json ./inventory.yaml | jq -r '.groups[2].targets[0].uri')"" | |
TARGET_HOST=$(yaml2json ./inventory.yaml | jq -r '.groups[2].targets[0].uri') 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/ |