Skip to content

Merge pull request #280 from sixwaaaay/vector #103

Merge pull request #280 from sixwaaaay/vector

Merge pull request #280 from sixwaaaay/vector #103

Workflow file for this run

#
# Copyright (c) 2023-2024 sixwaaaay.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
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: "9.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@v3
with:
file: sharp/content.Tests/merged.cobertura.xml
flags: content
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
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