Skip to content

Commit

Permalink
ci: Consolidate linter into container run and remove simple test
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Dec 15, 2024
1 parent ea3ca2d commit 215bc25
Showing 1 changed file with 6 additions and 40 deletions.
46 changes: 6 additions & 40 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ on:

jobs:

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
recursive: true
ignore: DL3018

build:
runs-on: ubuntu-latest
permissions:
Expand All @@ -32,6 +23,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run linter
uses: hadolint/[email protected]
with:
recursive: true
ignore: DL3018

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/[email protected]
Expand Down Expand Up @@ -74,34 +71,3 @@ jobs:
platforms: linux/amd64
#platforms: linux/amd64,linux/arm/v7,linux/arm/v6
no-cache: true

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/[email protected]
- name: Start containers
run: |
sudo apt-get install -y docker-compose
docker-compose up --build --force-recreate --detach
- name: Run Tests
run: |
set -x
docker-compose ps
name=$(docker-compose ps | grep swtpm-test | awk '{print $1}')
rc=$(docker wait "${name}")
if [ "${rc}" != "0" ]; then
echo "test failed:"
docker logs "${name}"
exit 1
fi
- name: Logs
if: always()
run: docker-compose logs

- name: Stop containers
if: always()
run: docker-compose down

0 comments on commit 215bc25

Please sign in to comment.