Skip to content

Commit

Permalink
Split test with build
Browse files Browse the repository at this point in the history
  • Loading branch information
text-adi committed Apr 7, 2024
1 parent 6f98585 commit a4935dc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a4935dc

Please sign in to comment.