diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d39d5a31..d71912ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ on: push: branches: - - "**" + - master pull_request: branches: - master @@ -41,7 +41,19 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 2 - name: Build images run: docker-compose -f e2e/docker-compose.yml build + - name: Show GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Set commit message for push + if: github.event_name == 'push' + run: echo "GIT_LOG_MESSAGE=$(git log -1 --pretty=%B ${{env.GITHUB_SHA}})" >> $GITHUB_ENV + - name: Set commit message for pull request + if: github.event_name == 'pull_request' + run: echo "GIT_LOG_MESSAGE=$(git log -1 --pretty=%B ${{github.event.pull_request.head.sha}})" >> $GITHUB_ENV - name: Run tests run: docker-compose -f e2e/docker-compose.yml up --build --force-recreate --exit-code-from cypress diff --git a/e2e/cypress/snapshots/dozze_dark.spec.js/Dozzle default mode -- home screen.snap.png b/e2e/cypress/snapshots/dozze_dark.spec.js/Dozzle default mode -- home screen.snap.png index 5817fe0b..92c7e48d 100644 Binary files a/e2e/cypress/snapshots/dozze_dark.spec.js/Dozzle default mode -- home screen.snap.png and b/e2e/cypress/snapshots/dozze_dark.spec.js/Dozzle default mode -- home screen.snap.png differ diff --git a/e2e/cypress/support/commands.js b/e2e/cypress/support/commands.js index 9ba9b6f6..82f98729 100644 --- a/e2e/cypress/support/commands.js +++ b/e2e/cypress/support/commands.js @@ -33,7 +33,5 @@ Cypress.Commands.add("removeDates", () => { }); Cypress.Commands.add("replaceSkippedElements", () => { - cy.window().then((win) => - win.document.querySelectorAll("[data-ci-skip]").forEach((el) => (el.style.visibility = "hidden")) - ); + cy.window().then((win) => win.document.querySelectorAll("[data-ci-skip]").forEach((el) => el.remove())); }); diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 5d2ed67c..b8646500 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -37,6 +37,7 @@ services: - COMMIT_INFO_BRANCH=${GITHUB_REF_NAME} - COMMIT_INFO_AUTHOR=${GITHUB_ACTOR} - COMMIT_INFO_SHA=${GITHUB_SHA} + - COMMIT_INFO_MESSAGE=${GIT_LOG_MESSAGE} - COMMIT_INFO_REMOTE=https://github.com/amir20/dozzle command: cypress run --record depends_on: