mirror of
https://github.com/crazy-max/diun.git
synced 2025-03-16 04:13:30 +00:00
102 lines
2.6 KiB
YAML
102 lines
2.6 KiB
YAML
name: e2e
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'v*'
|
|
paths-ignore:
|
|
- '**.md'
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
- 'v*'
|
|
paths-ignore:
|
|
- '**.md'
|
|
|
|
env:
|
|
BUILD_TAG: 'diun:local'
|
|
CONTAINER_NAME: 'diun'
|
|
DOCKER_BUILD_SUMMARY: false
|
|
|
|
jobs:
|
|
e2e:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
redis:
|
|
image: redis:6.2.3-alpine
|
|
cloudflared:
|
|
image: crazymax/cloudflared:latest
|
|
options: >-
|
|
--label "diun.enable=true"
|
|
--label "diun.watch_repo=true"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- folder: docker1
|
|
loglevel: debug
|
|
- folder: docker2
|
|
loglevel: info
|
|
- folder: docker3
|
|
loglevel: info
|
|
- folder: docker4
|
|
loglevel: info
|
|
- folder: docker5
|
|
loglevel: info
|
|
- folder: dockerfile1
|
|
loglevel: debug
|
|
- folder: dockerfile2
|
|
loglevel: debug
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
-
|
|
name: Build
|
|
uses: docker/bake-action@v6
|
|
with:
|
|
source: .
|
|
targets: image-local
|
|
-
|
|
name: Start container
|
|
run: |
|
|
volFlags="-v $(pwd)/test/${{ matrix.folder }}/diun.yml:/diun.yml:ro"
|
|
volFlags="-v /var/run/docker.sock:/var/run/docker.sock ${volFlags}"
|
|
if [ -d "$(pwd)/test/${{ matrix.folder }}/mount" ]; then
|
|
volFlags="-v $(pwd)/test/${{ matrix.folder }}/mount:/mount ${volFlags}"
|
|
fi
|
|
docker run -d --name ${{ env.CONTAINER_NAME }} ${volFlags} \
|
|
-e "TZ=Europe/Paris" \
|
|
-e "LOG_LEVEL=${{ matrix.loglevel }}" \
|
|
${{ env.BUILD_TAG }}
|
|
-
|
|
name: Check container logs
|
|
uses: crazy-max/.github/.github/actions/container-logs-check@main
|
|
with:
|
|
container_name: ${{ env.CONTAINER_NAME }}
|
|
log_check: "Next run in"
|
|
timeout: 240
|
|
-
|
|
name: List images in db
|
|
run: |
|
|
docker exec -t ${{ env.CONTAINER_NAME }} diun image list
|
|
-
|
|
name: Container logs
|
|
if: always()
|
|
run: |
|
|
docker logs ${{ env.CONTAINER_NAME }}
|
|
docker rm -f ${{ env.CONTAINER_NAME }} > /dev/null 2>&1 || true
|