diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index 47a0af7..7c5744d 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -64,11 +64,36 @@ jobs: path: build/ # the Jekyll build directory include-hidden-files: true # Workaround https://github.com/actions/upload-artifact/issues/610 + # Test the test tools themselves + test-test: + name: Test tools validation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # Installing Node + modern Yarn on GitHub Actions requires hack + # https://github.com/actions/setup-node/issues/531#issuecomment-2960522861 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + - name: Enable Corepack + run: corepack enable + - name: Configure dependency cache + uses: actions/setup-node@v4 + with: + cache: yarn + - name: Install dependencies + run: yarn install --immutable + + - name: Test test tools + run: yarn run test-test + # Test the build artifact test: name: Test runs-on: ubuntu-latest - needs: build + needs: [build, test-test] steps: - uses: actions/checkout@v4 diff --git a/package.json b/package.json index b536272..1a76422 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "structured-data-testing-tool": "^4.5.0" }, "scripts": { - "test": "yarn node test/fixtures-html-validate-should-fail.mjs && yarn node test/fixtures-structured-data-should-fail.mjs && yarn node test/build-html-validate.mjs && yarn node test/dirty-file-paths-checker.mjs && yarn node test/build-structured-data-validate.mjs", + "test": "yarn node test/build-html-validate.mjs && yarn node test/dirty-file-paths-checker.mjs && yarn node test/build-structured-data-validate.mjs", + "test-test": "yarn node test/fixtures-html-validate-should-fail.mjs && yarn node test/fixtures-structured-data-should-fail.mjs", "test-structured-data": "yarn node test/build-structured-data-validate.mjs", "lint": "yarn prettier-check && yarn markdownlint-check", "lint-fix": "yarn prettier-fix && yarn markdownlint-fix",