Skip to content

tests: Extend regex's with optional match for Attributes in profiles #253

tests: Extend regex's with optional match for Attributes in profiles

tests: Extend regex's with optional match for Attributes in profiles #253

Workflow file for this run

name: Docker
on:
workflow_dispatch:
workflow_call:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
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:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/[email protected]
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
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