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

PR test runner #4140

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Separate run_tests and test_and_deploy into separate files.
saurtron committed Jan 8, 2025
commit bd43a2e5478e04a729610b3fb5d52e6ae094d697
35 changes: 35 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run Tests

on:
# pull_request
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does more than pull request. I know I am being picky lol

workflow_dispatch:
pull_request:
push:
branches:
- 'master'

jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Upload Event File
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}

- name: Checkout Repository
uses: actions/checkout@v4

- name: Run Tests
run: docker compose -f tools/headless_testing/docker-compose.yml up
timeout-minutes: 30

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results
path: |
tools/headless_testing/testlog/results.json
47 changes: 23 additions & 24 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
name: Run Tests
name: Process Tests

on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'
workflow_run:
workflows: ["Run Tests"]
types:
- completed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions: {}

jobs:
run-tests:
name: Run Tests
process-test-results:
name: Process Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Run Tests
run: docker compose -f tools/headless_testing/docker-compose.yml up
timeout-minutes: 30

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
action_fail: true
action_fail_on_inconclusive: true
check_name: "Test Results"
check_name: "Test Results (${{ github.event.workflow_run.event || github.event_name }})"
time_unit: milliseconds
files: "tools/headless_testing/testlog/results.json"

commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/Test Results/*.json"
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: run-tests
needs: process-test-results
if: |
github.repository == 'beyond-all-reason/Beyond-All-Reason' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master'
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'master'
permissions:
id-token: write
steps: