49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
description: "Target environment"
|
|
required: true
|
|
default: "testing"
|
|
type: choice
|
|
options:
|
|
- testing
|
|
- staging
|
|
- production
|
|
|
|
jobs:
|
|
# YAML anchor for common job configuration
|
|
integration-test: &integration-test
|
|
runs-on: general
|
|
container:
|
|
image: "ghcr.io/catthehacker/ubuntu:js-24.04"
|
|
env:
|
|
TARGET_ENVIRONMENT: ${{ github.event.inputs.environment }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y python3-pytest python3-requests
|
|
|
|
- name: Run integration tests
|
|
run: |
|
|
pytest run_test.py
|
|
|
|
testing:
|
|
if: github.event.inputs.environment == 'testing'
|
|
environment: testing
|
|
<<: *integration-test
|
|
|
|
staging:
|
|
if: github.event.inputs.environment == 'staging'
|
|
environment: staging
|
|
<<: *integration-test
|
|
|
|
production:
|
|
if: github.event.inputs.environment == 'production'
|
|
environment: production
|
|
<<: *integration-test
|