diff --git a/.github/actions/setup-and-validate/action.yml b/.github/actions/setup-and-validate/action.yml index cc9ded1b7..8f19afd34 100644 --- a/.github/actions/setup-and-validate/action.yml +++ b/.github/actions/setup-and-validate/action.yml @@ -17,6 +17,22 @@ runs: - name: create generated dir run: mkdir ./assets/generated shell: bash + + - name: create dependencies + run: npm run generate:licenses; npm run generate:images; npm run generate:charging-stations; npm run generate:service-worker + shell: bash + + - name: sync translations + run: npm run generate:translations + shell: bash + + - name: generate layeroverview + run: npm run reset:layeroverview + shell: bash + + - name: run tests + run: npm run test + shell: bash - name: Prepare deploy run: npm run prepare-deploy diff --git a/package.json b/package.json index f422d31e2..5172c9c48 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "generate:service-worker": "tsc service-worker.ts --outFile public/service-worker.js && git_hash=$(git rev-parse HEAD) && sed -i \"s/GITHUB-COMMIT/$git_hash/\" public/service-worker.js", "optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "generate:stats": "vite-node scripts/GenerateSeries.ts", - "reset:layeroverview": "echo {\\\"themes\\\":[]} > ./assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json && rm -f ./assets/generated/layers/*.json && rm -f ./assets/generated/themes/*.json && npm run generate:layeroverview && vite-node scripts/generateLayerOverview.ts -- --force", + "reset:layeroverview": "mkdir -p ./assets/generated/layers; echo {\\\"themes\\\":[]} > ./assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json && rm -f ./assets/generated/layers/*.json && rm -f ./assets/generated/themes/*.json && cp ./assets/layers/usersettings/usersettings.json ./assets/generated/layers/usersettings.json && npm run generate:layeroverview && vite-node scripts/generateLayerOverview.ts -- --force", "generate": "mkdir -p ./assets/generated; npm run generate:licenses; npm run generate:images; npm run generate:charging-stations; npm run generate:translations; npm run reset:layeroverview; npm run generate:service-worker", "generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -", "prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh", diff --git a/scripts/build.sh b/scripts/build.sh index 7bc55d541..897ee629a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -14,9 +14,6 @@ export NODE_OPTIONS="--max-old-space-size=8192" # This script ends every line with '&&' to chain everything. A failure will thus stop the build npm run generate:editor-layer-index && npm run generate && -npm run generate:translations && -npm run test && -npm run generate:layeroverview && npm run generate:layouts if [ $? -ne 0 ]; then