From 1684fcd0de722fe79f8d2ef1e96f50b1baeba205 Mon Sep 17 00:00:00 2001 From: Aleksandr Antciferov Date: Wed, 2 Oct 2024 23:26:43 +0200 Subject: [PATCH] call reusable workflow --- .github/workflows/docker-image.yml | 10 +++------- .github/workflows/pull-request.yml | 11 +++++++++++ .github/workflows/tests.yml | 7 +------ 3 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d72f5de..f3239b0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,7 +2,8 @@ name: Publish Docker image on: push: - branches: ["master"] + branches: + - master jobs: push_to_registry: @@ -24,12 +25,7 @@ jobs: ${{ runner.os }}-buildx- - name: Wait for tests to succeed - uses: lewagon/wait-on-check-action@v1.3.4 - with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - check-name: "Run tests" - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 + uses: ./.github/workflows/tests.yml - name: Log in to Docker Hub uses: docker/login-action@v2.1.0 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..d6db2ec --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,11 @@ +name: Run tests on pull request + +on: + pull_request: + branches: + - master + +jobs: + run_tests: + name: Run tests + uses: ./.github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a6c4f04..ebc7abd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,7 @@ name: Run tests on: - push: - branches: - - master - pull_request: - branches: - - master + workflow_call: jobs: test: