-
Notifications
You must be signed in to change notification settings - Fork 48
90 lines (79 loc) · 2.41 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "CI"
on:
push:
branches:
- master
pull_request:
env:
TEST_IMAGE_NAME: hadolint-action:${{github.sha}}
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
container: pipelinecomponents/hadolint:0.10.1
steps:
- uses: actions/checkout@v2
- name: Run hadolint
run: hadolint Dockerfile
build-test:
name: Build and Test
runs-on: ubuntu-20.04
needs: ["lint"]
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t $TEST_IMAGE_NAME .
- name: Run Structure tests
uses: brpaz/structure-tests-action@v1.1.2
with:
image: ${{ env.TEST_IMAGE_NAME }}
integration-tests:
name: Integration Tests
runs-on: ubuntu-20.04
needs: build-test
steps:
- uses: actions/checkout@v2
- name: Run integration test 1
uses: ./
with:
dockerfile: testdata/Dockerfile
- name: Run integration test 2 - ignore a rule
# This step is supposed to print out an info level rule violation
# but completely ignore the two rules listed below
uses: ./
with:
dockerfile: testdata/warning.Dockerfile
ignore: DL3014 DL3008 DL3015
- name: Run integration test 3 - set failure threshold
# This step will print out an info level rule violation, but not fail
# because of the high failure threshold.
uses: ./
with:
dockerfile: testdata/info.Dockerfile
failure-threshold: warning
- name: Run integration test 4 - output format
# This step will never fail, but will print out rule violations as json.
uses: ./
with:
dockerfile: testdata/warning.Dockerfile
failure-threshold: error
format: json
- name: Run integration test 4 - output format
# This step will never fail, but will print out rule violations.
uses: ./
with:
dockerfile: testdata/warning.Dockerfile
config: testdata/hadolint.yaml
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Release
runs-on: ubuntu-20.04
needs: integration-tests
steps:
- uses: actions/checkout@v2
- uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/git
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}