From f96c4403199b409d4e9525862759902ee2ed658e Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sat, 10 Apr 2021 15:39:00 +0200 Subject: [PATCH] Let GH actions fail if the licenses are missing --- .github/workflows/pull_request_check.yml | 22 +++++++++++++++++++--- .github/workflows/theme_validation.yml | 4 ++-- package.json | 2 ++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull_request_check.yml b/.github/workflows/pull_request_check.yml index f1f8cf7..b76182f 100644 --- a/.github/workflows/pull_request_check.yml +++ b/.github/workflows/pull_request_check.yml @@ -8,10 +8,26 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/npm@master + + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v1.2.0 + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + + - name: install deps + run: npm install + + - name: create generated dir + run: mkdir ./assets/generated + + - name: create stub themes + run: "echo '{\"layers\": [], \"themes\": []}' > ./assets/generated/known_layers_and_themes.json" + + - name: Compile license info - run: npm run generate:licenses + run: npm run validate:licenses - name: Compile and validate themes and layers - run: npm run generate:layeroverview + run: npm run validate:layeroverview diff --git a/.github/workflows/theme_validation.yml b/.github/workflows/theme_validation.yml index a66f5af..1173e2f 100644 --- a/.github/workflows/theme_validation.yml +++ b/.github/workflows/theme_validation.yml @@ -26,7 +26,7 @@ jobs: - name: Compile license info - run: npm run generate:licenses + run: npm run validate:licenses - name: Compile and validate themes and layers - run: npm run generate:layeroverview + run: npm run validate:layeroverview diff --git a/package.json b/package.json index a9865fd..442d319 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "generate:docs": "ts-node scripts/generateDocs.ts", "generate:layeroverview": "ts-node scripts/generateLayerOverview.ts --no-fail", "generate:licenses": "ts-node scripts/generateLicenseInfo.ts --no-fail", + "validate:layeroverview": "ts-node scripts/generateLayerOverview.ts", + "validate:licenses": "ts-node scripts/generateLicenseInfo.ts", "optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "generate": "npm run generate:images && npm run generate:translations && npm run generate:licenses", "build": "rm -rf dist/ && npm run generate && parcel build --public-url ./ *.html assets/** assets/**/** assets/**/**/** vendor/* vendor/*/*",