forked from pyouroboros/ouroboros
-
-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (56 loc) · 1.54 KB
/
test-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Test Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
name: Docker Test on ubuntu-latest
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
driver-opts: network=host
- name: Update Version String
run: |
sed -i -r 's/VERSION = "custom"/VERSION = "0.0+test"/' pyouroboros/__init__.py
echo $?\
- name: Build Docker
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
cache-from: type=gha,scope=main
tags: localhost:5000/tester/ouroboros:test
- name: Build Docker (main)
if: github.ref_name == 'main'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: localhost:5000/tester/ouroboros:test
- name: Test with Docker
run: |
sudo mkdir -p /app/pyouroboros/hooks
docker run --rm --name ouroboros -v /var/run/docker.sock:/var/run/docker.sock localhost:5000/tester/ouroboros:test --run-once --dry-run