Skip to content

Commit

Permalink
Rename generate_github_integration_tests_without_db_matrix to write_g…
Browse files Browse the repository at this point in the history
…ithub_integration_tests_without_db_matrix and write matrix directly to the GITHUB_OUTPUT file.

Remove toJSON in prepare-matrix outputs definition
  • Loading branch information
tkilias committed Aug 25, 2023
1 parent 930a192 commit a263d30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration_tests_without_db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:

- id: generate_integration_tests_without_db
name: "Generate list of integration tests without DB"
run: poetry run -- nox -s generate_github_integration_tests_without_db_matrix >> "$GITHUB_OUTPUT"
run: poetry run -- nox -s write_github_integration_tests_without_db_matrix
outputs:
test-path: ${{ toJSON(steps.generate_integration_tests_without_db.outputs.matrix) }}
test-path: ${{ steps.generate_integration_tests_without_db.outputs.matrix }}

debug:
needs: prepare_matrix
Expand Down
11 changes: 8 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
from pathlib import Path

import nox
Expand Down Expand Up @@ -54,10 +55,14 @@ def generate_github_integration_tests_without_db_matrix_json(session: Session):


@nox.session(python=False)
def generate_github_integration_tests_without_db_matrix(session: Session):
def write_github_integration_tests_without_db_matrix(session: Session):
json_str = _generate_github_integration_tests_without_db_matrix()
github_output_definition = f'matrix={{ "include": {json_str} }}'
print(github_output_definition)
github_output_definition = f'matrix={json_str}'
if "GITHUB_OUTPUT" in os.environ:
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
print(github_output_definition, file=fh)
else:
print(github_output_definition)


@nox.session(python=False)
Expand Down

0 comments on commit a263d30

Please sign in to comment.