Skip to content

Commit d821689

Browse files
committed
Initial commit
1 parent 6e067aa commit d821689

File tree

7 files changed

+95
-7
lines changed

7 files changed

+95
-7
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "build-test"
2+
on: [pull_request]
3+
4+
jobs:
5+
check-pr:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: checkout source
9+
uses: actions/checkout@v1
10+
11+
- name: docker build
12+
run: docker build . -t container-structure-test:dev
13+
14+
- name: run action
15+
uses: ./
16+
with:
17+
image: container-structure-test:dev
18+
config: test/test.yaml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM alpine:3.11.2
2+
3+
RUN apk add curl
4+
5+
RUN curl -LO https://storage.googleapis.com/container-structure-test/v1.8.0/container-structure-test-linux-amd64 \
6+
&& chmod +x container-structure-test-linux-amd64 \
7+
&& mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test

LICENSE

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
MIT License
21

3-
Copyright (c) 2020 Plex Systems
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2018 GitHub, Inc. and contributors
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
910
copies of the Software, and to permit persons to whom the Software is
1011
furnished to do so, subject to the following conditions:
1112

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
1415

1516
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1617
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1718
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1819
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1920
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1-
# container-structure-test-action
1+
# container-structure-test-action
2+
3+
![Build Status](https://github.com/plexsystems/container-structure-test-action/workflows/build-test/badge.svg)
4+
5+
6+
Setup [container-structure-test](https://github.com/GoogleContainerTools/container-structure-test) for use in your [GitHub Action](https://github.com/features/actions) workflows.
7+
8+
```
9+
NOTE: This action assumes a Linux environment, and will not work on Windows or MacOS.
10+
```
11+
12+
## Required inputs
13+
14+
- `image`: the image (including :tag) to run container structure test against (e.g. `my-image:latest`)
15+
- `config`: the path (relative to the root of the repository) to the test config (e.g. `tests.yaml`)
16+
17+
## Example
18+
19+
```yaml
20+
name: "Test Dockerfile structure"
21+
on: pull_request
22+
23+
jobs:
24+
dockerfile-test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: checkout source
28+
uses: actions/checkout@master
29+
30+
- name: run structure tests
31+
uses: plexsystems/container-structure-test-action@v0.1.0
32+
with:
33+
image: my-image:latest
34+
config: tests.yaml
35+
```

action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Container Structure Test Action"
2+
description: "Setup Container Structure Test in your GitHub workflows"
3+
author: "Plex Systems"
4+
5+
inputs:
6+
image:
7+
description: "Image (including :tag) to test"
8+
config:
9+
description: "Path (relative to the root of the repository) to the test config"
10+
branding:
11+
icon: 'anchor'
12+
color: 'blue'
13+
runs:
14+
using: "docker"
15+
image: "Dockerfile"
16+
args:
17+
- container-structure-test
18+
- test
19+
- --image
20+
- ${{ inputs.image }}
21+
- --config
22+
- ${{ inputs.config }}

test/test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
schemaVersion: 2.0.0
2+
3+
commandTests:
4+
- name: "binary runnable"
5+
command: "container-structure-test"

0 commit comments

Comments
 (0)