From 2c041bdc430ea1c56b9ae9080761c82fec568682 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Thu, 25 Jul 2024 17:58:49 +0200 Subject: [PATCH] Add GitHub actions jobs which runs `golden-diff` for each test case --- .github/workflows/test.yml | 19 +++++++++++++++++++ gitlab/Makefile | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d7d0be..6126dc7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,3 +31,22 @@ jobs: pattern: | *.sh step-* + + test_gitlab_generator_script_define_cases: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Find test cases + run: | + make -sC gitlab list_test_instances >> "$GITHUB_OUTPUT" + + test_gitlab_generator_script: + needs: tests_gitlab_generator_script_define_cases + strategy: + matrix: + instance: ${{ fromJSON(needs.test_gitlab_generator_script_define_cases.outputs.instances) }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + make -C gitlab golden-diff -e instance=${{ matrix.instance }} diff --git a/gitlab/Makefile b/gitlab/Makefile index 670ed47..18d098b 100644 --- a/gitlab/Makefile +++ b/gitlab/Makefile @@ -35,3 +35,8 @@ gen-golden-all: $(test_instances) .PHONY: $(test_instances) $(test_instances): $(MAKE) $(recursive_target) -e instance=$(basename $(@F)) + +.PHONY: list_test_instances +list_test_instances: JSONNET_ENTRYPOINT=jsonnet +list_test_instances: + $(JSONNET_DOCKER) --ext-str instances="$(test_instances)" -e 'std.split(std.extVar("instances"), " ")'