Update Dockerfile #412
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker images | |
on: push | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push-docker-images: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
fail-fast: true | |
max-parallel: 1 | |
matrix: | |
container: | |
- name: "vsyncer" | |
path: "Dockerfile" | |
- name: "vsyncer-ci" | |
path: ".github/workflows/ci.dockerfile" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/open-s4c/${{ matrix.container.name }} | |
tags: | | |
type=edge,branch=main | |
type=raw,latest | |
type=sha,format=long | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5.1.0 | |
with: | |
context: .github | |
file: ${{ matrix.container.path }} | |
cache-from: type=gha,scope=${{ matrix.container }} | |
cache-to: type=gha,mode=max,scope=${{ matrix.container }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
"VSYNCER_TAG=${{ github.sha }}" | |
# Run integration tests inside the created vsyncer-ci container | |
integration-tests: | |
runs-on: ubuntu-latest | |
needs: [ build-and-push-docker-images ] | |
container: ghcr.io/open-s4c/vsyncer-ci:sha-${{ github.sha }} | |
steps: | |
- name: print vsyncer version | |
run: vsyncer version | |
- name: Check out to run with the tests | |
uses: actions/checkout@v4 | |
- run: cmake -S./tests -Bbuild -DVSYNCER_LOCAL=OFF | |
- run: cmake --build build | |
- run: ctest --test-dir build --output-on-failure | |
- name: Upload Report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: check-report | |
path: build/log.csv | |