Files
chia-blockchain/.github/workflows/test.yml
T
Kyle AltendorfandGitHub 458697b519 reusable workflow for a single test workflow (#11722)
* reusable workflow for a single test workflow with coverage collection

* avoid needing typing-extensions to build workflow jobs

* remove incorrect coverage job

* correct enabling of pytest-monitor

* $Env:GITHUB_*

* tweak concurrency

* add explanation for use of the reusable workflow

* name: Generate matrix configuration

* correct timelord installation choice logic

* avoid * to fix coverage combining on windows

* name: Configure matrix

* bring back the conditional run

* less matrix.os.matrix

* hmm

* again

* exclude instead

* fixup JOB_FILE_NAME

* leave the final coverage step for later

* drop configuration.runs in favor of matrix excludes

* fixup os checks

* actions/cache@v3
2022-06-03 16:56:52 -05:00

78 lines
2.0 KiB
YAML

name: test
on:
push:
branches:
- long_lived/**
- main
- release/**
tags:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch: null
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
jobs:
configure:
name: Configure matrix
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Generate matrix configuration
id: configure
run: |
python tests/build-job-matrix.py --per directory --verbose > matrix.json
cat matrix.json
echo ::set-output name=configuration::$(cat matrix.json)
echo ::set-output name=steps::$(cat some.json)
outputs:
configuration: ${{ steps.configure.outputs.configuration }}
macos:
uses: ./.github/workflows/test-single.yml
needs: configure
with:
emoji: 🍎
matrix: macos
name: macOS
file_name: macos
concurrency_name: macos
configuration: ${{ needs.configure.outputs.configuration }}
runs-on: macos-latest
ubuntu:
uses: ./.github/workflows/test-single.yml
needs: configure
with:
emoji: 🐧
matrix: ubuntu
name: Ubuntu
file_name: ubuntu
concurrency_name: ubuntu
configuration: ${{ needs.configure.outputs.configuration }}
runs-on: ubuntu-latest
windows:
uses: ./.github/workflows/test-single.yml
needs: configure
with:
emoji: 🪟
matrix: windows
name: Windows
file_name: windows
concurrency_name: windows
configuration: ${{ needs.configure.outputs.configuration }}
runs-on: windows-latest