Skip to content

Commit

Permalink
Add GitHub actions jobs which runs golden-diff for each test case
Browse files Browse the repository at this point in the history
  • Loading branch information
simu committed Jul 25, 2024
1 parent 4611553 commit dd8067d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,29 @@ jobs:
pattern: |
*.sh
step-*
test_gitlab_generator_script_discover_cases:
name: Discover golden test cases
runs-on: ubuntu-latest
outputs:
instances: ${{ steps.instances.outputs.instances }}
steps:
- uses: actions/checkout@v4
- name: Find test cases
id: instances
run: |
instances=$(make -sC gitlab list_test_instances)
echo "instances=${instances}"
echo "instances=${instances}" >> "$GITHUB_OUTPUT"
test_gitlab_generator_script:
needs: test_gitlab_generator_script_discover_cases
strategy:
matrix:
instance: ${{ fromJSON(needs.test_gitlab_generator_script_discover_cases.outputs.instances) }}
runs-on: ubuntu-latest
name: 'Golden test: ${{ matrix.instance }}'
steps:
- uses: actions/checkout@v4
- run: |
make -C gitlab golden-diff -e instance=${{ matrix.instance }}
5 changes: 5 additions & 0 deletions gitlab/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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="$(basename $(notdir $(test_instances)))" -e 'std.split(std.extVar("instances"), " ")' | jq -c

0 comments on commit dd8067d

Please sign in to comment.