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 <stefanb@linux.ibm.com>
  • Loading branch information
stefanberger committed Dec 16, 2024
1 parent 3086fb1 commit 8aca762
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/hadolint-action@v3.1.0
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/hadolint-action@v3.1.0
with:
recursive: true
ignore: DL3018

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3.0.0
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/setup-buildx-action@v3.0.0
- 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 8aca762

Please sign in to comment.