catalog/.github/workflows/test.yaml

60 lines
1.9 KiB
YAML
Raw Normal View History

2022-09-22 08:04:38 -04:00
name: Sync multiple branches
2022-09-22 08:07:38 -04:00
concurrency: catalog-test
2022-09-22 08:04:38 -04:00
on:
2023-12-20 14:46:34 -05:00
push:
branches:
- 'staging'
2022-09-22 08:04:38 -04:00
workflow_dispatch:
2022-11-24 04:27:59 -05:00
2022-09-22 08:04:38 -04:00
jobs:
test-and-sync:
name: Test and Sync SCALE Catalog
runs-on: ubuntu-latest
steps:
2022-11-24 09:41:55 -05:00
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
name: Checkout
with:
token: ${{ secrets.BOT_TOKEN }}
2022-11-24 08:15:08 -05:00
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
name: Checkout-validate
with:
fetch-depth: 1
repository: truecharts/catalog_validation
token: ${{ secrets.BOT_TOKEN }}
2022-11-24 10:09:02 -05:00
path: .catalog_validation
2022-11-24 08:20:00 -05:00
2022-11-24 08:15:08 -05:00
- name: install catalog_validation
2022-11-24 08:23:49 -05:00
shell: bash
run: |
2022-11-24 10:40:22 -05:00
cd .catalog_validation
2022-11-24 08:15:08 -05:00
pip install -r requirements.txt
pip install -U --no-cache-dir .
cd -
2022-09-22 08:04:38 -04:00
- name: catalog tests
2022-11-24 08:23:49 -05:00
shell: bash
2022-09-22 08:04:38 -04:00
run: |
echo "Starting Catalog Validation"
2023-05-02 13:14:47 -04:00
python3 .catalog_validation/catalog_validation/scripts/catalog_validate.py validate --path "${PWD}" --ignore-catalog-json
2022-11-24 04:27:59 -05:00
- name: catalog json generation
2022-11-24 08:23:49 -05:00
shell: bash
2022-11-24 04:27:59 -05:00
run: |
echo "Starting Catalog json Generation"
2022-11-24 11:20:22 -05:00
python3 .catalog_validation/catalog_validation/scripts/catalog_update.py update --path "${PWD}"
2022-11-24 04:27:59 -05:00
2022-09-22 08:38:29 -04:00
- name: Merge staging into main
2022-11-24 08:23:49 -05:00
shell: bash
2022-09-22 08:34:58 -04:00
run: |
2022-11-24 11:30:31 -05:00
cd "/home/runner/work/catalog/catalog/"
2022-11-24 07:16:21 -05:00
git config user.name "TrueCharts-Bot"
git config user.email "bot@truecharts.org"
2022-11-24 12:13:11 -05:00
git add catalog.json || echo "Adding catalog.json failed"
2023-11-17 03:43:37 -05:00
git add **/app_versions.json || echo "Adding app_version.json files failed"
git commit --all -m "Commit app_versions.json and catalog.json" || echo "Commiting app_versions.json and catalog.json failed"
2022-11-24 04:27:59 -05:00
git push -f origin staging:main