Skip to content

Commit

Permalink
Publish with os-specific actions thoroughly, composite once per OS
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Feb 22, 2024
1 parent 45925c9 commit ded28bd
Showing 1 changed file with 194 additions and 18 deletions.
212 changes: 194 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
with:
sarif_file: ${{ steps.scan.outputs.sarif }}

publish-composite:
publish-linux:
name: Publish Test Results (${{ matrix.os-label }} python ${{ matrix.python }})
runs-on: ${{ matrix.os }}
permissions:
Expand All @@ -224,10 +224,72 @@ jobs:

strategy:
fail-fast: false
max-parallel: 3
max-parallel: 2
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
include:
- os: ubuntu-latest
os-label: Linux
python: "3.8"
- os: ubuntu-latest
os-label: Linux
python: "venv"
- os: ubuntu-latest
os-label: Linux
python: "installed"
- os: ubuntu-20.04
os-label: Linux 20.04
python: "installed"

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

- name: Setup Python
if: matrix.python != 'installed' && matrix.python != 'venv'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install virtualenv
if: matrix.python == 'venv'
run: python3 -m pip install virtualenv
shell: bash

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Results
id: test-results
uses: ./linux
with:
check_name: Test Results (${{ matrix.os-label }} python ${{ matrix.python }})
files: artifacts/**/*.xml
json_file: "tests.json"
json_suite_details: true
json_test_case_results: true
report_suite_logs: "any"

- name: JSON output
uses: ./misc/action/json-output
with:
json: '${{ steps.test-results.outputs.json }}'
json_file: 'tests.json'

publish-macos:
name: Publish Test Results (${{ matrix.os-label }} python ${{ matrix.python }})
runs-on: ${{ matrix.os }}
permissions:
checks: write
pull-requests: write

strategy:
fail-fast: false
max-parallel: 2
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# test *-latest and newer (because newer eventually become 'latest' and should be tested to work before that)
include:
- os: macos-latest
os-label: macOS
Expand All @@ -248,19 +310,56 @@ jobs:
os-label: macOS 14
python: "installed"

- os: ubuntu-latest
os-label: Linux
python: "3.8"
- os: ubuntu-latest
os-label: Linux
python: "venv"
- os: ubuntu-latest
os-label: Linux
python: "installed"
- os: ubuntu-20.04
os-label: Linux 20.04
python: "installed"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
if: matrix.python != 'installed' && matrix.python != 'venv'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install virtualenv
if: matrix.python == 'venv'
run: python3 -m pip install virtualenv
shell: bash

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Results
id: test-results
uses: ./macos
with:
check_name: Test Results (${{ matrix.os-label }} python ${{ matrix.python }})
files: artifacts/**/*.xml
json_file: "tests.json"
json_suite_details: true
json_test_case_results: true
report_suite_logs: "any"

- name: JSON output
uses: ./misc/action/json-output
with:
json: '${{ steps.test-results.outputs.json }}'
json_file: 'tests.json'

publish-windows:
name: Publish Test Results (${{ matrix.os-label }} python ${{ matrix.python }})
runs-on: ${{ matrix.os }}
permissions:
checks: write
pull-requests: write

strategy:
fail-fast: false
max-parallel: 2
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
include:
- os: windows-latest
os-label: Windows
python: "installed"
Expand All @@ -283,8 +382,7 @@ jobs:

- name: Install virtualenv
if: matrix.python == 'venv'
run: |
python3 -m pip install virtualenv
run: python3 -m pip install virtualenv
shell: bash

- name: Download Artifacts
Expand All @@ -294,9 +392,87 @@ jobs:

- name: Publish Test Results
id: test-results
uses: ./composite
uses: ./windows
with:
check_name: Test Results (${{ matrix.os-label }} python ${{ matrix.python }})
files: artifacts\**\*.xml
json_file: "tests.json"
json_suite_details: true
json_test_case_results: true
report_suite_logs: "any"

- name: JSON output
uses: ./misc/action/json-output
with:
json: '${{ steps.test-results.outputs.json }}'
json_file: 'tests.json'

- name: Publish Test Results (Bash)
id: test-results-bash
uses: ./windows-bash
with:
check_name: Test Results (${{ matrix.os-label }} bash python ${{ matrix.python }})
files: artifacts\**\*.xml
json_file: "tests.json"
json_suite_details: true
json_test_case_results: true
report_suite_logs: "any"

- name: JSON output (Bash)
uses: ./misc/action/json-output
with:
json: '${{ steps.test-results-bash.outputs.json }}'
json_file: 'tests.json'

publish-composite:
name: Publish Test Results (${{ matrix.os-label }} composite)
runs-on: ${{ matrix.os }}
permissions:
checks: write
pull-requests: write

strategy:
fail-fast: false
max-parallel: 1
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# test *-latest and newer (because newer eventually become 'latest' and should be tested to work before that)
include:
- os: macos-latest
os-label: macOS
python: "installed"
- os: ubuntu-latest
os-label: Linux
python: "installed"
- os: windows-latest
os-label: Windows
python: "installed"

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

- name: Setup Python
if: matrix.python != 'installed' && matrix.python != 'venv'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install virtualenv
if: matrix.python == 'venv'
run: python3 -m pip install virtualenv
shell: bash

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Results
id: test-results
uses: ./composite
with:
check_name: Test Results (${{ matrix.os-label }} composite python ${{ matrix.python }})
files: |
artifacts/**/*.xml
artifacts\**\*.xml
Expand Down

0 comments on commit ded28bd

Please sign in to comment.