-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (47 loc) · 1.3 KB
/
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
name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
container:
image: golang:alpine
steps:
- uses: actions/checkout@v3
- name: install
run: |
apk update
apk add git python3 make gcc linux-headers libc-dev py-pip
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- name: Fix permission
run: git config --global --add safe.directory $PWD
- name: test
run: go test -v ./...
- name: unittest
run: |
source .venv/bin/activate
./scripts/ovl_unittest.py
- name: e2e_test
run: |
source .venv/bin/activate
./test/overlord_e2e_unittest.py
build:
needs: test
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
run: docker build -t aitjcize/overlord:latest .
- name: Push Docker image
run: docker push aitjcize/overlord:latest