Skip to content

Commit

Permalink
Add integration test using Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Javex committed May 24, 2024
1 parent 4ac2b55 commit 0692d37
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go
name: Build & Test

on:
push:
Expand All @@ -11,7 +11,7 @@ on:

jobs:

build:
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,3 +26,19 @@ jobs:

- name: Test
run: go test -v ./...

integration_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Integration Test
run: |
docker build -f test/Dockerfile . -t caddy-fail2ban
docker run --rm --name caddy-fail2ban --detach -v $PWD/test/Caddyfile:/etc/caddy/Caddyfile caddy-fail2ban
docker exec caddy-fail2ban /usr/local/bin/caddy-fail2ban-test.sh
docker logs caddy-fail2ban
docker stop caddy-fail2ban
File renamed without changes.

0 comments on commit 0692d37

Please sign in to comment.