mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
ci: remove unimportant and complicated job filtering
This commit is contained in:
56
.github/workflows/integration-test.yaml
vendored
56
.github/workflows/integration-test.yaml
vendored
@@ -24,40 +24,17 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# This job is used as a workaround to a limitation when using a matrix of
|
||||
# variations that a job should be executed against. The limitation is that a
|
||||
# matrix once defined can't include any conditions.
|
||||
#
|
||||
# What this job does before our real test job with a matrix of variations run,
|
||||
# is to decide on that matrix of variations a conditional logic of our choice.
|
||||
#
|
||||
# For more details, see this excellent stack overflow answer:
|
||||
# https://stackoverflow.com/a/65434401/2220152
|
||||
#
|
||||
decide-on-test-jobs-to-run:
|
||||
name: Decide on test jobs to run
|
||||
runs-on: ubuntu-latest
|
||||
integration-tests:
|
||||
# integration tests run in a container,
|
||||
# not in the worker, so this version is not relevant to the tests
|
||||
# and can be the same for all tested versions
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
|
||||
steps:
|
||||
# Currently, this logic filters out a matrix entry equaling a specific git
|
||||
# reference identified by "dont_run_on_ref".
|
||||
- name: Decide on test jobs to run
|
||||
id: set-matrix
|
||||
run: |
|
||||
matrix_post_filter=$(
|
||||
echo "$matrix_include_pre_filter" \
|
||||
| yq e --output-format=json '.' - \
|
||||
| jq -c '{"include": map( . | select(.dont_run_on_ref != "${{ github.ref }}" ))}'
|
||||
)
|
||||
echo "matrix=$matrix_post_filter" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "The subsequent job's matrix are:"
|
||||
echo $matrix_post_filter | jq -C '.'
|
||||
env:
|
||||
matrix_include_pre_filter: |
|
||||
name: ${{ matrix.name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: "Debian 11, Py 3.9"
|
||||
distro_image: "debian:11"
|
||||
runs_on: "ubuntu-22.04"
|
||||
@@ -78,19 +55,6 @@ jobs:
|
||||
distro_image: "ubuntu:22.04"
|
||||
extra_flags: --upgrade-from=0.2.0
|
||||
|
||||
integration-tests:
|
||||
needs: decide-on-test-jobs-to-run
|
||||
|
||||
# integration tests run in a container,
|
||||
# not in the worker, so this version is not relevant to the tests
|
||||
# and can be the same for all tested versions
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
name: ${{ matrix.name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.decide-on-test-jobs-to-run.outputs.matrix) }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
|
||||
Reference in New Issue
Block a user