Skip to content

Commit

Permalink
ci: implement test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
schuer committed Dec 11, 2023
1 parent 574029b commit ddf0e8d
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,48 @@ concurrency:
cancel-in-progress: true

jobs:
collect:
name: Collect images from directories
runs-on: ubuntu-latest
outputs:
IMAGES: ${{ steps.images.outputs.directories }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Collect images from directories
id: images
run: |
cd images
directories=$(tree -J -d -L 1 | jq -c '.[0].contents | map(.name)')
echo $directories
echo "directories=$directories" >> $GITHUB_OUTPUT
test:
name: Test the images
name: Test
runs-on: ubuntu-latest
needs: [collect]

strategy:
fail-fast: false
matrix:
image: ${{ fromJson(needs.collect.outputs.IMAGES) }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ matrix.image }}

- name: Test build
run: docker run --rm ${{ matrix.image }}

0 comments on commit ddf0e8d

Please sign in to comment.