Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add workflow for tox verify #90

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/compose-tox-verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: Compose Tox Verify

# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
GERRIT_BRANCH:
description: "Branch that change is against"
required: true
type: string
GERRIT_CHANGE_ID:
description: "The ID for the change"
required: true
type: string
GERRIT_CHANGE_NUMBER:
description: "The Gerrit number"
required: true
type: string
GERRIT_CHANGE_URL:
description: "URL to the change"
required: true
type: string
GERRIT_EVENT_TYPE:
description: "Type of Gerrit event"
required: true
type: string
GERRIT_PATCHSET_NUMBER:
description: "The patch number for the change"
required: true
type: string
GERRIT_PATCHSET_REVISION:
description: "The revision sha"
required: true
type: string
GERRIT_PROJECT:
description: "Project in Gerrit"
required: true
type: string
GERRIT_REFSPEC:
description: "Gerrit refspec of change"
required: true
type: string
PRE_BUILD_SCRIPT:
description: "Optional pre-build script to trigger before verify run"
required: false
default: ""
type: string
TOX_DIR:
description: "Working directory for tox to run"
required: false
default: "."
type: string

concurrency:
# yamllint disable-line rule:line-length
group: compose-tox-verify-${{ github.workflow }}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
cancel-in-progress: true

jobs:
tox-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.GERRIT_BRANCH }}
submodules: "true"
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: "3.8"
- name: Check if pre-build-script file exists
id: check_pre-build_file
uses: andstor/file-existence-action@v1
with:
files: ${{ inputs.PRE_BUILD_SCRIPT }}
- name: Run pre-build-script
if: steps.check_pre-build_file.outputs.files_exists == 'true'
run: ${{ inputs.PRE_BUILD_SCRIPT }}
- name: Run Tox Verify
uses: ymyzk/run-tox-gh-actions@main
with:
working-directory: ${{ inputs.TOX_DIR }}