diff --git a/.github/workflows/reusable-e2e-tests.yml b/.github/workflows/reusable-e2e-tests.yml index 675e52de..8013f01b 100644 --- a/.github/workflows/reusable-e2e-tests.yml +++ b/.github/workflows/reusable-e2e-tests.yml @@ -35,13 +35,16 @@ jobs: with: node-version-file: ${{ inputs.node-version-file }} node-version: ${{ inputs.node-version }} + cache: yarn + cache-dependency-path: yarn.lock + # We install project dependencies to be able to run e2e-launcher.js + - run: yarn install --frozen-lockfile + + # But we do install log4brains from the registry - run: npm install -g ${{ inputs.npm-package-fullname }} - # TODO: test the preview and add some assertions :-) For now we just check the exit codes. Or manage to run e2e-tests/e2e-launcher.js from here - - name: Tests - run: | - log4brains --version - log4brains init --defaults - log4brains adr list - log4brains build + # We don't use "yarn e2e" directly so we are sure that we are using the global version of log4brains + - name: E2E Tests on the registry version + run: node e2e-launcher.js + working-directory: e2e-tests diff --git a/e2e-tests/e2e-launcher.js b/e2e-tests/e2e-launcher.js index e2f02a4b..4658e4e5 100644 --- a/e2e-tests/e2e-launcher.js +++ b/e2e-tests/e2e-launcher.js @@ -33,6 +33,8 @@ async function run(file, arguments, cwd) { (async () => { await usingTempDir(async (cwd) => { + await run("log4brains", ["--version"], cwd); + await run("log4brains", ["init", "--defaults"], cwd); await run("log4brains", ["adr", "new", "--quiet", '"E2E test ADR"'], cwd);