content native #31
Workflow file for this run
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: "Content" | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'sharp/**' | |
- '.github/workflows/compose.content.yaml' | |
pull_request: | |
paths: | |
- 'sharp/**' | |
- '.github/workflows/compose.content.yaml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Docker Compose | |
working-directory: .github/chore | |
run: | | |
docker compose -f compose.content.yaml up -d | |
- name: Setup C# environment | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Install FFmpeg | |
run: | | |
sudo apt-get update | |
sudo apt-get install ffmpeg | |
- name: Install dependencies | |
run: | | |
dotnet tool install -g dotnet-coverage | |
dotnet restore sharp/content/content.csproj | |
dotnet restore sharp/content.Tests/content.Tests.csproj | |
- name: Coverage | |
working-directory: sharp/content.Tests | |
run: | | |
dotnet test --collect "Code Coverage;Format=cobertura" | |
dotnet-coverage merge -o merged.cobertura.xml -f cobertura TestResults/**/*.cobertura.xml | |
env: | |
CONNECTION_STRING: "server=localhost;port=33306;database=content;user=mysql_user;password=mysql;SslMode=none;Max Pool Size=2;AllowPublicKeyRetrieval=True; " | |
USER_STRING: "http://localhost:50051" | |
VOTE_STRING: "http://localhost:8080" | |
FFPROBE_PATH: "/usr/bin/ffprobe" | |
- name: Upload coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
file: sharp/content.Tests/merged.cobertura.xml | |
flags: content | |
fail_ci_if_error: true | |
container: | |
name: Container Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./sharp/content | |
file: ./sharp/content/Dockerfile | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME || 'app' }}/content:latest |