Update README.md #20
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: Dockerized CI with Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Install Docker Compose | |
run: | | |
DOCKER_COMPOSE_VERSION=2.20.2 | |
curl -L "https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
docker-compose version | |
- name: Start Docker Services | |
run: | | |
docker compose -f compose.yaml up --build -d | |
shell: bash | |
- name: Restore .NET Dependencies | |
run: dotnet restore | |
shell: bash | |
- name: Build .NET Solution | |
run: dotnet build --no-restore --configuration Debug | |
shell: bash | |
- name: Run Tests | |
run: dotnet test --no-build --configuration Debug --verbosity normal | |
shell: bash | |
- name: Cleanup Docker Services | |
if: always() | |
run: docker compose -f compose.yaml down --volumes | |
shell: bash |