1
0
Fork 0
mirror of https://github.com/hadolint/hadolint-action.git synced 2024-08-16 10:09:53 +02:00
hadolint/.github/workflows/ci.yml

60 lines
1.3 KiB
YAML
Raw Normal View History

2019-10-02 22:50:00 +02:00
name: "CI"
on:
push:
branches:
- master
pull_request:
env:
TEST_IMAGE_NAME: hadolint-action:${{github.sha}}
jobs:
lint:
2020-12-06 10:46:26 +01:00
name: Lint
runs-on: ubuntu-20.04
container: pipelinecomponents/hadolint:0.10.1
2019-10-02 22:50:00 +02:00
steps:
2020-12-06 10:46:26 +01:00
- uses: actions/checkout@v2
2019-10-02 22:50:00 +02:00
- name: Run hadolint
run: hadolint Dockerfile
2020-12-06 10:46:26 +01:00
build-test:
name: Build and Test
runs-on: ubuntu-20.04
needs: ["lint"]
2019-10-02 22:50:00 +02:00
steps:
2020-12-06 10:46:26 +01:00
- uses: actions/checkout@v2
2019-10-02 22:50:00 +02:00
- name: Build Docker image
run: docker build -t $TEST_IMAGE_NAME .
- name: Run Structure tests
2020-12-06 10:46:26 +01:00
uses: brpaz/structure-tests-action@v1.1.2
2019-10-02 22:50:00 +02:00
with:
2020-12-06 10:46:26 +01:00
image: ${{ env.TEST_IMAGE_NAME }}
2019-10-02 22:50:00 +02:00
2020-12-06 10:46:26 +01:00
integration-tests:
2019-10-02 22:50:00 +02:00
name: Integration Tests
2020-12-06 10:46:26 +01:00
runs-on: ubuntu-20.04
needs: build-test
2019-10-02 22:50:00 +02:00
steps:
2020-12-06 10:46:26 +01:00
- uses: actions/checkout@v2
2019-10-02 22:58:07 +02:00
- name: Run integration test
uses: ./
2019-10-02 22:50:00 +02:00
with:
dockerfile: testdata/Dockerfile
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Release
2020-12-06 10:46:26 +01:00
runs-on: ubuntu-20.04
needs: integration-tests
2019-10-02 22:50:00 +02:00
steps:
2020-12-06 10:46:26 +01:00
- uses: actions/checkout@v2
- uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/git
2019-10-02 22:50:00 +02:00
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}