Skip to content

Commit

Permalink
feat: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
brpaz authored Feb 16, 2025
1 parent 43d5a77 commit 79362e1
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 16 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [published]

env:
TEST_IMAGE_TAG: structure-tests-action:test
TEST_IMAGE_TAG: structure-tests-action:${{ github.sha }}

jobs:
lint:
Expand All @@ -21,8 +21,8 @@ jobs:
with:
dockerfile: Dockerfile

build:
name: Build and Test
test:
name: Test
runs-on: ubuntu-latest
needs: [lint]
steps:
Expand All @@ -42,15 +42,8 @@ jobs:
load: true
tags: ${{ env.TEST_IMAGE_TAG }}

- name: Install container-structure-test
run: |
curl -LO https://github.com/GoogleContainerTools/container-structure-test/releases/download/v1.17.0/container-structure-test-linux-amd64 \
&& chmod +x container-structure-test-linux-amd64 \
&& mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test \
&& container-structure-test version
- name: Run tests
run: |
container-structure-test test \
--image ${{ env.TEST_IMAGE_TAG }} \
--config structure-tests.yaml
- name: Test
uses: ./
with:
image: ${{ env.TEST_IMAGE_TAG }}
configFile: structure-tests.yaml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ devenv.local.nix

# pre-commit
.pre-commit-config.yaml

tags
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,50 @@

## Usage

### Basic usage

```yml
steps:
uses: brpaz/structure-tests-action@v1
uses: brpaz/structure-tests-action@1.3.0
with:
image: myimage:latest
configFile: structure-tests.yaml
```
### With Docker Actions
```yaml
env:
TEST_IMAGE_TAG: image:${{ github.sha }}
jobs:
test:
name: Test
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build test image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_IMAGE_TAG }}

- name: Test
uses: brpaz/structure-tests-action@1.3.0
with:
image: ${{ env.TEST_IMAGE_TAG }}
configFile: structure-tests.yaml
```
## Inputs
**`image`**
Expand Down
Loading

0 comments on commit 79362e1

Please sign in to comment.