From bf4a33542c1f79d94d45ea9d04141421a9e1d000 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Mon, 10 Jun 2024 13:17:29 -0400 Subject: [PATCH 01/17] First draft of GH action --- .github/workflows/convert-yaml-to-json.yml | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/convert-yaml-to-json.yml diff --git a/.github/workflows/convert-yaml-to-json.yml b/.github/workflows/convert-yaml-to-json.yml new file mode 100644 index 0000000..e3aa32e --- /dev/null +++ b/.github/workflows/convert-yaml-to-json.yml @@ -0,0 +1,26 @@ +name: convert-yaml-to-json + +on: + [push] + # push: + # branches: ["main"] + # pull_request: + # branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run python script + run: | + python convert-yaml.py yaml_notifications json_notifications From 6a4130bc4c9859662f1d3f7591e73c3ad5d9343e Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Mon, 10 Jun 2024 13:43:26 -0400 Subject: [PATCH 02/17] Add example yaml file --- test/data/yaml/example.yaml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/data/yaml/example.yaml diff --git a/test/data/yaml/example.yaml b/test/data/yaml/example.yaml new file mode 100644 index 0000000..6798a46 --- /dev/null +++ b/test/data/yaml/example.yaml @@ -0,0 +1,41 @@ +--- +- id: f103c749-9932-48bb-8f61-2e8ed2beacc3 + start_at: "2012-03-29T10:05:45-06:00" + end_at: "2024-05-03T15:49:20.331Z" + title: hello user - this needs translation + description: lorem ipsum user - this needs translation + CTA: lorem ipsum user - this needs translation + URL: https://thunderbird.net + severity: 5 + type: donation + targeting: + percent_chance: 100 + exclude: + - locales: [] + versions: [] + channels: [] + operating_systems: [] + include: + - locales: [] + versions: [] + channels: [] +- id: f103c749-9932-48bb-8f61-2e8ed2beacc3 + start_at: "2024-05-03T15:49:20.331Z" + end_at: "2024-05-03T15:49:20.331Z" + title: hello user - this needs translation + description: lorem ipsum user - this needs translation + CTA: lorem ipsum user - this needs translation + URL: https://thunderbird.net + severity: 5 + type: donation + targeting: + percent_chance: 10 + exclude: + - locales: [] + versions: [] + channels: [] + operating_systems: [] + include: + - locales: [] + versions: [] + channels: [] From b4f6eeb5dd67ae76fc64dcab047ebe24c3dd97cc Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Mon, 10 Jun 2024 13:58:01 -0400 Subject: [PATCH 03/17] Use test dirs for yaml input and json output --- .github/workflows/convert-yaml-to-json.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/convert-yaml-to-json.yml b/.github/workflows/convert-yaml-to-json.yml index e3aa32e..cf6ff74 100644 --- a/.github/workflows/convert-yaml-to-json.yml +++ b/.github/workflows/convert-yaml-to-json.yml @@ -23,4 +23,4 @@ jobs: pip install -r requirements.txt - name: Run python script run: | - python convert-yaml.py yaml_notifications json_notifications + python convert-yaml.py test/data/yaml test/data/json From 8630c65f7a11d6047ce3c12f0bc739a346c6539e Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Mon, 24 Jun 2024 18:23:14 -0400 Subject: [PATCH 04/17] Only run when new `.yaml` files are pushed to the `/yaml` directory --- .github/workflows/convert-yaml-to-json.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/convert-yaml-to-json.yml b/.github/workflows/convert-yaml-to-json.yml index cf6ff74..70577f6 100644 --- a/.github/workflows/convert-yaml-to-json.yml +++ b/.github/workflows/convert-yaml-to-json.yml @@ -1,11 +1,9 @@ name: convert-yaml-to-json on: - [push] - # push: - # branches: ["main"] - # pull_request: - # branches: ["main"] + push: + paths: + - "yaml/**.yaml" jobs: build: From dd7463b3574586e0969d9bb93a34fa0424a04136 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Thu, 11 Jul 2024 18:43:36 -0400 Subject: [PATCH 05/17] run against real yaml directory, rename workflow file --- .github/workflows/{convert-yaml-to-json.yml => convert.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{convert-yaml-to-json.yml => convert.yml} (88%) diff --git a/.github/workflows/convert-yaml-to-json.yml b/.github/workflows/convert.yml similarity index 88% rename from .github/workflows/convert-yaml-to-json.yml rename to .github/workflows/convert.yml index 70577f6..0013ebd 100644 --- a/.github/workflows/convert-yaml-to-json.yml +++ b/.github/workflows/convert.yml @@ -21,4 +21,4 @@ jobs: pip install -r requirements.txt - name: Run python script run: | - python convert-yaml.py test/data/yaml test/data/json + python convert-yaml.py yaml json From 4670971d6002d6c3cce7a14ca37f45590e96d740 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Thu, 11 Jul 2024 19:05:39 -0400 Subject: [PATCH 06/17] Make validate_json callable from another workflow --- .github/workflows/validate.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 53519d1..cf4181c 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,27 +1,37 @@ name: validate-json on: - [push] - # push: - # branches: ["main"] - # pull_request: - # branches: ["main"] + workflow_call: + push: + branches: ["*"] + pull_request: + branches: ["*"] + workflow_dispatch: jobs: build: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 + - name: Set up Go uses: actions/setup-go@v5 with: go-version: ">=1.22.4" + - name: Install dependencies run: go install github.com/santhosh-tekuri/jsonschema/cmd/jv@latest + - name: Validate JSON files + id: validate_json run: | if [ -d "json" ] && [ "$(ls -A json/*.json 2>/dev/null)" ]; then jv schema.json json/*.json else echo "No JSON files to process." fi + + - name: Save state + if: steps.validate_json.conclusion == 'success' + run: echo "JV_COMMAND_SUCCESS=true" >> $GITHUB_ENV From cd642c6135c4ce59e86ba37db44a51cce9d4b34c Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Thu, 11 Jul 2024 19:07:28 -0400 Subject: [PATCH 07/17] Give distinct names to jobs --- .github/workflows/convert.yml | 2 +- .github/workflows/validate.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/convert.yml b/.github/workflows/convert.yml index 0013ebd..fde38ab 100644 --- a/.github/workflows/convert.yml +++ b/.github/workflows/convert.yml @@ -6,7 +6,7 @@ on: - "yaml/**.yaml" jobs: - build: + convert: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index cf4181c..75a3d3a 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: jobs: - build: + validate: runs-on: ubuntu-latest steps: From 040182fc534ad3ce00b615220927a8d4bc2436bb Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Thu, 11 Jul 2024 21:01:03 -0400 Subject: [PATCH 08/17] Make validate both standalone and reusable, add inputs and outputs --- .github/workflows/validate.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 75a3d3a..622e929 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -2,19 +2,36 @@ name: validate-json on: workflow_call: - push: - branches: ["*"] + inputs: + should_download: + description: "Download JSON artifacts if called by another workflow?" + type: boolean + outputs: + is_valid: + description: "Is the JSON valid?" + value: ${{ jobs.validate.outputs.is_valid}} + pull_request: branches: ["*"] + workflow_dispatch: jobs: validate: runs-on: ubuntu-latest + outputs: + is_valid: ${{ steps.save_state.outputs.is_valid}} steps: - uses: actions/checkout@v4 + - name: Download JSON artifacts # if called by another workflow + if: ${{ inputs.should_download }} + uses: actions/download-artifact@v4 + with: + name: json-files + path: json + - name: Set up Go uses: actions/setup-go@v5 with: @@ -33,5 +50,6 @@ jobs: fi - name: Save state + id: save_state if: steps.validate_json.conclusion == 'success' - run: echo "JV_COMMAND_SUCCESS=true" >> $GITHUB_ENV + run: echo "is_valid=true" >> $GITHUB_OUTPUT From ee5ee6a362d0d10e2649599d199d60d9b3ae99da Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Thu, 11 Jul 2024 21:02:19 -0400 Subject: [PATCH 09/17] Calls validate workflow, commits new JSON files only if valid --- .github/workflows/convert.yml | 51 +++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/.github/workflows/convert.yml b/.github/workflows/convert.yml index fde38ab..dc0497c 100644 --- a/.github/workflows/convert.yml +++ b/.github/workflows/convert.yml @@ -6,19 +6,66 @@ on: - "yaml/**.yaml" jobs: - convert: + convert-yaml: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" cache: "pip" + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt + - name: Run python script run: | - python convert-yaml.py yaml json + if [ -d "yaml" ] && [ "$(ls -A yaml/*.yaml 2>/dev/null)" ]; then + python convert-yaml.py yaml json + else + echo "No YAML files to process." + fi + + - name: Upload JSON artifacts for validation + uses: actions/upload-artifact@v4 + with: + name: json-files + path: json/*.json + + validate-json: + needs: convert-yaml + uses: ./.github/workflows/validate.yml + with: + should_download: true + + commit-json: + runs-on: ubuntu-latest + needs: validate-json + + steps: + - uses: actions/checkout@v4 + + - name: Check for validation success and file changes + run: | + if [ "${{ needs.validate-json.outputs.is_valid }}" != "true" ]; then + echo "JSON is not valid. Skipping commit." + echo "NO_COMMIT=true" >> $GITHUB_ENV + elif git diff --quiet; then + echo "No changes to commit" + echo "NO_COMMIT=true" >> $GITHUB_ENV + fi + + - name: Commit changes + if: ${{ env.NO_COMMIT != 'true' }} + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + git add . + git commit -m "Automated commit by GitHub Action" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a656e91ad54d08dfbf9cb3248cd60f58c541127d Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Tue, 16 Jul 2024 18:17:04 -0400 Subject: [PATCH 10/17] Added dummy yaml file for testing --- yaml/example.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 yaml/example.yaml diff --git a/yaml/example.yaml b/yaml/example.yaml new file mode 100644 index 0000000..6798a46 --- /dev/null +++ b/yaml/example.yaml @@ -0,0 +1,41 @@ +--- +- id: f103c749-9932-48bb-8f61-2e8ed2beacc3 + start_at: "2012-03-29T10:05:45-06:00" + end_at: "2024-05-03T15:49:20.331Z" + title: hello user - this needs translation + description: lorem ipsum user - this needs translation + CTA: lorem ipsum user - this needs translation + URL: https://thunderbird.net + severity: 5 + type: donation + targeting: + percent_chance: 100 + exclude: + - locales: [] + versions: [] + channels: [] + operating_systems: [] + include: + - locales: [] + versions: [] + channels: [] +- id: f103c749-9932-48bb-8f61-2e8ed2beacc3 + start_at: "2024-05-03T15:49:20.331Z" + end_at: "2024-05-03T15:49:20.331Z" + title: hello user - this needs translation + description: lorem ipsum user - this needs translation + CTA: lorem ipsum user - this needs translation + URL: https://thunderbird.net + severity: 5 + type: donation + targeting: + percent_chance: 10 + exclude: + - locales: [] + versions: [] + channels: [] + operating_systems: [] + include: + - locales: [] + versions: [] + channels: [] From ef98758d629b3b38c7c9e6b0d4057177ab098a18 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Tue, 16 Jul 2024 19:15:59 -0400 Subject: [PATCH 11/17] Adds a python wrapper for the json validation command --- .github/workflows/convert.yml | 2 +- .github/workflows/validate.yml | 15 +++++---- json/example2.json | 60 ++++++++++++++++++++++++++++++++++ validate-json.py | 50 ++++++++++++++++++++++++++++ yaml/example.yaml | 2 ++ 5 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 json/example2.json create mode 100644 validate-json.py diff --git a/.github/workflows/convert.yml b/.github/workflows/convert.yml index dc0497c..d8f704e 100644 --- a/.github/workflows/convert.yml +++ b/.github/workflows/convert.yml @@ -22,7 +22,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - - name: Run python script + - name: Run convert-yaml.py run: | if [ -d "yaml" ] && [ "$(ls -A yaml/*.yaml 2>/dev/null)" ]; then python convert-yaml.py yaml json diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 622e929..2813ddc 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -32,22 +32,23 @@ jobs: name: json-files path: json + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + - name: Set up Go uses: actions/setup-go@v5 with: go-version: ">=1.22.4" - - name: Install dependencies + - name: Install Go dependencies run: go install github.com/santhosh-tekuri/jsonschema/cmd/jv@latest - name: Validate JSON files id: validate_json - run: | - if [ -d "json" ] && [ "$(ls -A json/*.json 2>/dev/null)" ]; then - jv schema.json json/*.json - else - echo "No JSON files to process." - fi + run: python validate-json.py schema.json json - name: Save state id: save_state diff --git a/json/example2.json b/json/example2.json new file mode 100644 index 0000000..d9a1239 --- /dev/null +++ b/json/example2.json @@ -0,0 +1,60 @@ +[ + { + "id": "f103c749-9932-48bb-8f61-2e8ed2beacc3", + "start_at": "2012-03-29T10:05:45-06:00", + "end_at": "2012-03-29T10:05:45-06:00", + "title": "hello user - this needs translation", + "description": "lorem ipsum user - this needs translation", + "CTA": "lorem ipsum user - this needs translation", + "URL": "https://thunderbird.net", + "severity": 5, + "type": "donation", + "targeting": { + "percent_chance": 10, + "exclude": [ + { + "locales": [], + "versions": [], + "channels": [], + "operating_systems": [] + } + ], + "include": [ + { + "locales": [], + "versions": [], + "channels": [] + } + ] + } + }, + { + "id": "f103c749-9932-48bb-8f61-2e8ed2beacc3", + "start_at": "2012-03-29T10:05:45-06:00", + "end_at": "2024-05-03T15:49:20.331Z", + "title": "hello user - this needs translation", + "description": "lorem ipsum user - this needs translation", + "CTA": "lorem ipsum user - this needs translation", + "URL": "https://thunderbird.net", + "severity": 5, + "type": "donation", + "targeting": { + "percent_chance": 10, + "exclude": [ + { + "locales": [], + "versions": [], + "channels": [], + "operating_systems": [] + } + ], + "include": [ + { + "locales": [], + "versions": [], + "channels": [] + } + ] + } + } +] diff --git a/validate-json.py b/validate-json.py new file mode 100644 index 0000000..7ace829 --- /dev/null +++ b/validate-json.py @@ -0,0 +1,50 @@ +import os +import subprocess +import sys +import argparse + +parser = argparse.ArgumentParser(description='Validate JSON schema and JSON files for Thunderbird notifications.') +parser.add_argument('schema_file', type=str, help='The schema file to validate against.') +parser.add_argument('json_dir', type=str, help='The directory containing JSON files.') +args = parser.parse_args() + +class JSONValidator: + def __init__(self, schema_file, json_dir): + self.schema_file = schema_file + self.json_dir = json_dir + + if not os.path.isfile(self.schema_file): + raise ValueError(f'Argument for schema file "{schema_file}" was not found.') + + if not os.path.isdir(self.json_dir): + raise ValueError(f'Argument for json_dir "{self.json_dir}" is not a directory') + + def validate(self): + json_files = [f for f in os.listdir(self.json_dir) if f.endswith('.json')] + print(json_files) + if not json_files: + print("No JSON files to process.") + return 0 # Exit successfully if no JSON files are found + + command = ['jv', self.schema_file] + [os.path.join(self.json_dir, f) for f in json_files] + + try: + result = subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + print('Validation command completed successfully') + return 0 + except subprocess.CalledProcessError as e: + print(f'Error running validation command: {e.stderr}', file=sys.stderr) + return 1 + +def main(): + if len(sys.argv) < 3 or len(sys.argv) > 4: + parser.print_help() + sys.exit(1) + + validator = JSONValidator(args.schema_file, args.json_dir) + exit_code = validator.validate() + sys.exit(exit_code) + +if __name__ == "__main__": + main() + diff --git a/yaml/example.yaml b/yaml/example.yaml index 6798a46..0cf4959 100644 --- a/yaml/example.yaml +++ b/yaml/example.yaml @@ -19,6 +19,7 @@ - locales: [] versions: [] channels: [] + operating_systems: [] - id: f103c749-9932-48bb-8f61-2e8ed2beacc3 start_at: "2024-05-03T15:49:20.331Z" end_at: "2024-05-03T15:49:20.331Z" @@ -39,3 +40,4 @@ - locales: [] versions: [] channels: [] + operating_systems: [] From 3faef913c00ce5b8a292592ca6399c98fbe558e5 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Tue, 16 Jul 2024 19:28:24 -0400 Subject: [PATCH 12/17] Fixes errors with example json file --- json/example2.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/json/example2.json b/json/example2.json index d9a1239..cb8a83e 100644 --- a/json/example2.json +++ b/json/example2.json @@ -23,7 +23,8 @@ { "locales": [], "versions": [], - "channels": [] + "channels": [], + "operating_systems": [] } ] } @@ -52,7 +53,8 @@ { "locales": [], "versions": [], - "channels": [] + "channels": [], + "operating_systems": [] } ] } From 1a9de6cfdaadff5e8317fd56c6deba79af0b526c Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Tue, 16 Jul 2024 19:29:23 -0400 Subject: [PATCH 13/17] Remove extraneous print(), show validation error --- validate-json.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/validate-json.py b/validate-json.py index 7ace829..bedecc9 100644 --- a/validate-json.py +++ b/validate-json.py @@ -21,7 +21,6 @@ def __init__(self, schema_file, json_dir): def validate(self): json_files = [f for f in os.listdir(self.json_dir) if f.endswith('.json')] - print(json_files) if not json_files: print("No JSON files to process.") return 0 # Exit successfully if no JSON files are found @@ -33,7 +32,7 @@ def validate(self): print('Validation command completed successfully') return 0 except subprocess.CalledProcessError as e: - print(f'Error running validation command: {e.stderr}', file=sys.stderr) + print(f'Error running validation command: {e.stdout}', file=sys.stdout) return 1 def main(): From a6fd072bb973145a77213a8c2e3426057aefbbd9 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Tue, 16 Jul 2024 19:29:54 -0400 Subject: [PATCH 14/17] Show json files being written --- convert-yaml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/convert-yaml.py b/convert-yaml.py index 1d4035f..3c843d3 100644 --- a/convert-yaml.py +++ b/convert-yaml.py @@ -53,6 +53,7 @@ def convert(self): should_write = args.overwrite or not does_exist if should_write: with open(json_file_path, "w") as f: + print(f'Writing {json_file_path}') self.write_schema_as_json(schema, f) def main(): From 17c993e6892f977b3e1031839f673f27e07bafc6 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Tue, 16 Jul 2024 19:30:41 -0400 Subject: [PATCH 15/17] If no yaml files, move handling from workflow file to python script --- .github/workflows/convert.yml | 7 +------ convert-yaml.py | 7 ++++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/convert.yml b/.github/workflows/convert.yml index d8f704e..88672f2 100644 --- a/.github/workflows/convert.yml +++ b/.github/workflows/convert.yml @@ -23,12 +23,7 @@ jobs: pip install -r requirements.txt - name: Run convert-yaml.py - run: | - if [ -d "yaml" ] && [ "$(ls -A yaml/*.yaml 2>/dev/null)" ]; then - python convert-yaml.py yaml json - else - echo "No YAML files to process." - fi + run: python convert-yaml.py yaml json - name: Upload JSON artifacts for validation uses: actions/upload-artifact@v4 diff --git a/convert-yaml.py b/convert-yaml.py index 3c843d3..79be427 100644 --- a/convert-yaml.py +++ b/convert-yaml.py @@ -41,7 +41,12 @@ def write_schema_as_json(self, schema, json_file): def convert(self): """Reads, validates YAML files from a directory and writes JSON files to separate directory.""" - for yaml_file_path in self.get_yaml_file_paths(): + yaml_file_paths = self.get_yaml_file_paths() + if not yaml_file_paths: + print("No YAML files to process.") + return + + for yaml_file_path in yaml_file_paths: schema = NotificationSchema.from_yaml(yaml_file_path) json_file_name = self.generate_json_file_name(yaml_file_path) From b35aba94bf6941caae54be8a938d3c630b294c90 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Tue, 16 Jul 2024 19:35:45 -0400 Subject: [PATCH 16/17] Workaround for error with actions/setup-python@v5 --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2813ddc..1995606 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -36,7 +36,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" - cache: "pip" + # cache: "pip" - name: Set up Go uses: actions/setup-go@v5 From 53570a73d73f8ed2874dcbd352928e05ad1e5db4 Mon Sep 17 00:00:00 2001 From: Chris Aquino Date: Wed, 17 Jul 2024 16:33:19 -0400 Subject: [PATCH 17/17] Re-enabling `cache:pip`, install deps as a separate step --- .github/workflows/validate.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1995606..0c43da1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -36,7 +36,12 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" - # cache: "pip" + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt - name: Set up Go uses: actions/setup-go@v5