Skip to content

Commit

Permalink
Added build and test github action (#11)
Browse files Browse the repository at this point in the history
* Added build and test github action
  • Loading branch information
andreygolubkow authored Dec 30, 2023
1 parent 3d14a72 commit 8c742e6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and test
on:
push:
branches:
- 'develop'
pull_request:
branches: [ develop ]

env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build API
uses: docker/build-push-action@v4
with:
context: ./
file: ./TaktTusur.Media.Api/Dockerfile
push: false
platforms: "linux/amd64"
- name: Build Background Crawler
uses: docker/build-push-action@v4
with:
context: ./
file: ./TaktTusur.Media.BackgroundCrawler/Dockerfile
push: false
platforms: "linux/amd64"
3 changes: 3 additions & 0 deletions TaktTusur.Media.Api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["TaktTusur.Media.Api/TaktTusur.Media.Api.csproj", "TaktTusur.Media.Api/"]
COPY ["TaktTusur.Media.Domain/TaktTusur.Media.Domain.csproj", "TaktTusur.Media.Domain/"]
COPY ["TaktTusur.Media.Domain.Tests/TaktTusur.Media.Domain.Tests.csproj", "TaktTusur.Media.Domain.Tests/"]
COPY ["TaktTusur.Media.Infrastructure/TaktTusur.Media.Infrastructure.csproj", "TaktTusur.Media.Infrastructure/"]
COPY ["TaktTusur.Media.Clients.VkApi/TaktTusur.Media.Clients.VkApi.csproj", "TaktTusur.Media.Clients.VkApi/"]
RUN dotnet restore "TaktTusur.Media.Api/TaktTusur.Media.Api.csproj"
COPY . .
WORKDIR "/src/TaktTusur.Media.Domain.Tests"
RUN dotnet test "TaktTusur.Media.Domain.Tests.csproj"
WORKDIR "/src/TaktTusur.Media.Api"
RUN dotnet build "TaktTusur.Media.Api.csproj" -c Release -o /app/build

Expand Down

0 comments on commit 8c742e6

Please sign in to comment.