Skip to content

Commit

Permalink
Add GitHub actions integration tests (#5)
Browse files Browse the repository at this point in the history
* Add dependabot and release yml

* Create dotnet-integration-tests.yml

* Update dotnet-integration-tests.yml

* Update dotnet-integration-tests.yml

* Update dotnet-integration-tests.yml

* Update dotnet-integration-tests.yml

* Create separate dockerfile for integration tests
  • Loading branch information
lanedirt authored Nov 24, 2024
1 parent e246b60 commit 215fbd9
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Enable version updates for NuGet
- package-ecosystem: "nuget"
directory: "/"
target-branch: "main"
open-pull-requests-limit: 10
labels:
- "dependencies"
# Check for updates once a week
schedule:
day: "monday"
time: "09:00"
interval: "weekly"
# Ignore certain dependencies (optional)
# ignore:
# - dependency-name: "SomePackage"
# versions: ["4.x", "5.x"]

# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
day: "monday"
time: "09:00"
interval: "weekly"

# Enable version updates for Docker
- package-ecosystem: "docker"
# Look for a `Dockerfile` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
day: "monday"
time: "09:00"
interval: "weekly"

# Enable version updates for Composer
- package-ecosystem: "composer"
# Look for a `Dockerfile` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
day: "monday"
time: "09:00"
interval: "weekly"
17 changes: 17 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# .github/release.yml

changelog:
categories:
- title: 🚀 New Features
labels:
- '*'
exclude:
labels:
- dependencies
- bug
- title: 🐞 Bug Fixes
labels:
- bug
- title: 🧩 Dependencies Updates
labels:
- dependencies
21 changes: 21 additions & 0 deletions .github/workflows/dotnet-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This workflow will test if running the integration tests works.
name: .NET Integration Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build integration tests image
run: docker build -t mov2gif-integration-tests -f src/Tests/Mov2Gif.IntegrationTests/Dockerfile .

- name: Run integration tests
run: docker run --rm mov2gif-integration-tests
19 changes: 19 additions & 0 deletions src/Tests/Mov2Gif.IntegrationTests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src

# Copy project files first for better layer caching
COPY ["src/Tests/Mov2Gif.IntegrationTests/Mov2Gif.IntegrationTests.csproj", "Tests/Mov2Gif.IntegrationTests/"]
COPY ["src/Utilities/Mov2Gif.Utilities.GifConverter/Mov2Gif.Utilities.GifConverter.csproj", "Utilities/Mov2Gif.Utilities.GifConverter/"]
RUN dotnet restore "Tests/Mov2Gif.IntegrationTests/Mov2Gif.IntegrationTests.csproj"

# Copy the rest of the source code
COPY ["src/Tests/Mov2Gif.IntegrationTests/", "Tests/Mov2Gif.IntegrationTests/"]
COPY ["src/Utilities/Mov2Gif.Utilities.GifConverter/", "Utilities/Mov2Gif.Utilities.GifConverter/"]

# Install FFmpeg
RUN apt-get update && \
apt-get install -y ffmpeg && \
rm -rf /var/lib/apt/lists/*

# Set the entry point to run tests
ENTRYPOINT ["dotnet", "test", "Tests/Mov2Gif.IntegrationTests/Mov2Gif.IntegrationTests.csproj", "--verbosity", "normal"]

0 comments on commit 215fbd9

Please sign in to comment.