Skip to content

Commit

Permalink
Merge pull request #114 from os-autoinst/action
Browse files Browse the repository at this point in the history
Add workflow for scheduling openQA test inside action
  • Loading branch information
baierjan committed May 29, 2023
2 parents 82ba42d + 0a0b06e commit 7bd405b
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/openqa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: openQA test
# yamllint disable-line rule:truthy
on:
pull_request_target:
# Note how this runs on:pull_request_target and not on:pull_request!
# The difference is that this runs always with the context of the master
# branch. This is necessary to allow accessing the API credential secrets.
workflow_dispatch:
env:
OPENQA_HOST: ${{ secrets.OPENQA_URL }}
OPENQA_API_KEY: ${{ secrets.OPENQA_API_KEY }}
OPENQA_API_SECRET: ${{ secrets.OPENQA_API_SECRET }}

jobs:
trigger_and_monitor_openqa:
runs-on: ubuntu-latest
container:
image: registry.opensuse.org/devel/openqa/containers-tw/tumbleweed:client
steps:
- uses: actions/checkout@v3
- name: Get latest build
id: latest_build
run: >-
echo build=$(curl -s
${OPENQA_HOST:-https://openqa.opensuse.org}/group_overview/${OPENQA_GROUP_ID:-1}.json
| jq -r '([ .build_results[] | select(.tag.description=="published") | select(.version=="Tumbleweed") | .build ] | sort | reverse)[]'
| head -n1) >> "$GITHUB_OUTPUT"
- name: Trigger and monitor openQA test
run: >-
openqa-cli schedule
--monitor
--host "${OPENQA_HOST:-https://openqa.opensuse.org}/"
--apikey "$OPENQA_API_KEY" --apisecret "$OPENQA_API_SECRET"
--param-file SCENARIO_DEFINITIONS_YAML=scenario-definitions.yaml
DISTRI=openQA VERSION=Tumbleweed FLAVOR=dev ARCH=x86_64
HDD_1=opensuse-Tumbleweed-x86_64-${{ steps.latest_build.outputs.build }}-Tumbleweed@64bit-3G.qcow2
BUILD="$GITHUB_REPOSITORY.git#$GITHUB_REF" _GROUP_ID="0"
CASEDIR="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git#$GITHUB_REF"
44 changes: 44 additions & 0 deletions scenario-definitions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
products:
openqa-*-dev-x86_64:
distri: openqa
flavor: dev
arch: x86_64
version: Tumbleweed

machines:
64bit-2G:
backend: qemu
settings:
HDDSIZEGB: "20"
QEMUCPU: host
QEMURAM: "2048"
WORKER_CLASS: qemu_x86_64

job_templates:
openqa_from_git:
product: openqa-*-dev-x86_64
machine: 64bit-2G
settings:
INSTALL: "1"
INSTALL_ONLY: "1"
UPDATE: "0"
OPENQA_FROM_GIT: "1"
openqa_from_containers:
product: openqa-*-dev-x86_64
machine: 64bit-2G
settings:
INSTALL: "1"
INSTALL_ONLY: "1"
UPDATE: "0"
OPENQA_FROM_GIT: "1"
OPENQA_CONTAINERS: "1"
openqa_install:
product: openqa-*-dev-x86_64
machine: 64bit-2G
settings:
OPENQA_HOST: "http://openqa.opensuse.org"
INSTALL: "1"
INSTALL_ONLY: "1"
UPDATE: "0"
PYTHON: "1"

0 comments on commit 7bd405b

Please sign in to comment.