60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
name: 'Docker Test'
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- .github/workflows/docker-test.yml
|
|
- Dockerfile
|
|
- scripts/**
|
|
- tests/**
|
|
|
|
jobs:
|
|
test:
|
|
name: Docker Test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
# network=host driver-opt needed to push to local registry
|
|
driver-opts: network=host
|
|
-
|
|
name: Build base image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: '.'
|
|
file: './Dockerfile'
|
|
tags: localhost:5000/base:dev
|
|
push: true
|
|
-
|
|
name: Build test image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: '.'
|
|
file: './tests/Dockerfile'
|
|
build-contexts: base=docker-image://localhost:5000/base:dev
|
|
tags: ttionya/vaultwarden-backup:test
|
|
load: true
|
|
-
|
|
name: Test
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y p7zip-full
|
|
bash tests/test.sh
|