diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index f981352..0000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install dependencies - run: npm ci - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run Playwright tests - run: npx playwright test - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 diff --git a/.github/workflows/verify-lua-script.yml b/.github/workflows/verify-lua-script.yml index e0ea559..e9b6550 100644 --- a/.github/workflows/verify-lua-script.yml +++ b/.github/workflows/verify-lua-script.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: @@ -18,15 +18,24 @@ jobs: luaVersion: "5.4" - name: build - run: | - make + run: make + + - name: Install Playwright Browsers + run: npx playwright install --with-deps - name: test - run: | - make test + run: make test - name: Archive production artifacts uses: actions/upload-artifact@v4 with: name: moneymoney-sankey - path: dist/SankeyChart.lua \ No newline at end of file + path: dist/SankeyChart.lua + + - name: Archive test reports + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 \ No newline at end of file diff --git a/Makefile b/Makefile index 6fb294f..e44d004 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ .DEFAULT_GOAL := dist INSTALL_DIR = ~/Library/Containers/com.moneymoney-app.retail/Data/Library/Application\ Support/MoneyMoney/Extensions OUTPUT_FILE = dist/SankeyChart.lua +TMP_DIR = tmp/ .PHONY: dist dist: clean - npm install + npm ci npm run build .PHONY: test @@ -23,4 +24,5 @@ distclean: rm dist/*.js clean: - rm -f dist/* && (rmdir dist/ || true) \ No newline at end of file + rm -f dist/* && (rmdir dist/ || true) + rm -rf $(TMP_DIR) \ No newline at end of file diff --git a/package.json b/package.json index a42a715..9ce0501 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,9 @@ "build:js": "tsc && terser --compress --mangle -- $npm_package_config_outputDir/*.js", "build": "npm-run-all build:* && mkdir -p $npm_package_config_outputDir && cp src/SankeyChart.lua $npm_package_config_outputDir && INLINE_CSS=`npm run build:css --silent` INLINE_JS=`npm run build:js --silent` node ./build.mjs", "test": "npm-run-all test:*", - "test:compile-validate": "lua ./src/SankeyChartTest.lua > tmp/index.html && html-validate tmp/index.html", - "test:placeholder": "grep -qE '{{ ([a-zA-Z_]+) }}' $npm_package_config_outputDir/*.lua && (echo 'error: placeholders have not been replaced in dist!' && exit 1) || exit 0", + "test:validate": "npm-run-all test:validate:*", + "test:validate:compile": "mkdir -p tmp && lua ./src/SankeyChartTest.lua > tmp/index.html && html-validate tmp/index.html", + "test:validate:placeholder": "grep -qE '{{ ([a-zA-Z_]+) }}' $npm_package_config_outputDir/*.lua && (echo 'error: placeholders have not been replaced in dist!' && exit 1) || exit 0", "test:e2e": "npx playwright test", "start": "http-server tmp/" },