diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 759a6d8..9be5a50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,10 +9,9 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.workflow_call.workflow_file }} cancel-in-progress: true - jobs: vars: name: Generation vars @@ -35,28 +34,13 @@ jobs: id: basic run: | echo "last_tag=${{ steps._tmp_last_tag.outputs.value }}" >> $GITHUB_OUTPUT - - - lint-dockerfile: - needs: [ vars ] - name: Test dockerfile - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check - run: | - docker run --rm -i -v ./hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < Dockerfile - lint-entrypoint: + run-test: needs: [ vars ] - name: Test bash script - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check - uses: ludeeus/action-shellcheck@master + name: Run test + uses: ./.github/workflows/test.yaml - build_and_push: + build-and-push: needs: [ vars, lint-dockerfile, lint-entrypoint ] name: Build runs-on: ubuntu-latest diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..83806a1 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +name: Test + +on: + push: + paths: + - '.github/workflows/test.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.workflow_call.workflow_file }} + cancel-in-progress: true + + +jobs: + lint-dockerfile: + name: Test dockerfile + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check + run: | + docker run --rm -i -v ./hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < Dockerfile + + lint-entrypoint: + name: Test bash script + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check + uses: ludeeus/action-shellcheck@master \ No newline at end of file