Fix build cache corruption ordering issue

This commit is contained in:
Mario Rogic 2022-08-21 08:42:17 +01:00
parent 195469806e
commit 08f36cc607
3 changed files with 13 additions and 6 deletions

View File

@ -4,6 +4,7 @@ on:
push: push:
branches: branches:
- master - master
- debug
pull_request: pull_request:
branches: branches:
- master - master
@ -39,8 +40,6 @@ jobs:
# Install npm packages, unless we restored them from cache. # Install npm packages, unless we restored them from cache.
# Since `npm ci` removes the node_modules folder before running its # Since `npm ci` removes the node_modules folder before running its
# important to skip this step if cache was restored. # important to skip this step if cache was restored.
- name: Lamdera Reset for tests
run: rm -rf elm-stuff $HOME/.elm
- name: npm ci - name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true' if: steps.cache-node_modules.outputs.cache-hit != 'true'
env: env:
@ -69,8 +68,7 @@ jobs:
- name: Build elm docs - name: Build elm docs
id: docs id: docs
run: npx --no-install elm make --docs docs.json run: npx --no-install elm make --docs docs.json
- name: Lamdera Reset for cypress
run: yes | lamdera reset
- name: Setup for cypress - name: Setup for cypress
run: (cd examples/end-to-end && npm install && npx elm-tooling install && rm -rf elm-stuff && npx elm-pages codegen && lamdera make app/Route/Index.elm) run: (cd examples/end-to-end && npm install && npx elm-tooling install && rm -rf elm-stuff && npx elm-pages codegen && lamdera make app/Route/Index.elm)
- name: Cypress tests - name: Cypress tests

View File

@ -7,7 +7,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "cd examples/end-to-end && npm i && npx elm-pages dev", "start": "cd examples/end-to-end && npm i && npx elm-pages dev",
"test": "set -x; (cd examples/routing && npm i && npm run build && elm-test-rs --compiler=lamdera) && npm run test:snapshot && npx elmi-to-json --version && rm -rf elm-stuff && elm-verify-examples --run-tests --elm-test-args '--compiler=lamdera' && elm-test-rs --compiler=lamdera && (cd generator && mocha)", "test": "./test.sh",
"test:snapshot": "(cd examples/escaping && npm install && npm test) && (cd examples/base-path && npm install && npm test)", "test:snapshot": "(cd examples/escaping && npm install && npm test) && (cd examples/base-path && npm install && npm test)",
"cypress": "npm start & cypress run", "cypress": "npm start & cypress run",
"review": "elm-review" "review": "elm-review"
@ -73,4 +73,4 @@
"bin": { "bin": {
"elm-pages": "generator/src/cli.js" "elm-pages": "generator/src/cli.js"
} }
} }

9
test.sh Executable file
View File

@ -0,0 +1,9 @@
set -ex;
root=`pwd`
yes | lamdera reset || true
elm-test-rs --compiler=lamdera
cd examples/routing && npm i && npm run build && elm-test-rs --compiler=lamdera && cd $root
npm run test:snapshot
npx elmi-to-json --version
elm-verify-examples --run-tests --elm-test-args '--compiler=lamdera'
cd generator && mocha && cd $root