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: dotnetdll test suite | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Detect which files were changed in this commit | |
uses: tj-actions/changed-files@v35 | |
id: changed-files | |
- name: Authenticate with GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get tags for image | |
id: metadata | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
- uses: docker/setup-buildx-action@v2 | |
- name: Build and publish Docker image (if the Dockerfile has changed) | |
uses: docker/build-push-action@v3 | |
if: github.event_name == 'push' && contains(steps.changed-files.outputs.all_changed_files, 'Dockerfile') | |
with: | |
# Explicitly pass file so that the repo isn't used as build context | |
# Nothing in the repo is actually used during build | |
file: Dockerfile | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: true | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
- run: docker compose run tests | |
env: | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 |