mirror of
https://github.com/hadolint/hadolint-action.git
synced 2026-05-15 14:45:53 +00:00
feat: first commit
This commit is contained in:
commit
0c77515c56
12 changed files with 260 additions and 0 deletions
81
.github/workflows/ci.yml
vendored
Normal file
81
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
name: "CI"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
TEST_IMAGE_NAME: hadolint-action:${{github.sha}}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
container: pipelinecomponents/hadolint:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Run hadolint
|
||||
run: hadolint Dockerfile
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: ['lint']
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build Docker image
|
||||
run: docker build -t $TEST_IMAGE_NAME .
|
||||
|
||||
- name: Save Docker image artifact
|
||||
run: docker save -o action.tar $TEST_IMAGE_NAME
|
||||
|
||||
- name: Upload image artifact
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: action-image
|
||||
path: action.tar
|
||||
|
||||
test:
|
||||
name: Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Pull Image artifact
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: action-image
|
||||
|
||||
- name: Load image into docker context
|
||||
run: docker load -i action-image/action.tar
|
||||
|
||||
- name: Get Image Name
|
||||
id: image_name
|
||||
run: echo "##[set-output name=image;]$(echo $TEST_IMAGE_NAME)"
|
||||
|
||||
- name: Run Structure tests
|
||||
uses: brpaz/structure-tests-action@master
|
||||
with:
|
||||
image: ${{ steps.image_name.outputs.image }}
|
||||
|
||||
integration:
|
||||
name: Integration Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: ./
|
||||
with:
|
||||
dockerfile: testdata/Dockerfile
|
||||
|
||||
release:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: integraiton
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Semantic Release
|
||||
uses: brpaz/action-semantic-release@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue