-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (29 loc) · 916 Bytes
/
build-test.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
name: Build & Test
on:
push:
branches: "**"
pull_request:
branches: [main]
env:
DOCKER_ENV_FILE: ".github/workflows/docker.env"
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Build the Docker image
run: docker build --target builder --file Dockerfile --tag majodev/go-docker-vscode:${GITHUB_SHA:8} .
- name: Create container
run: docker run -d --env-file $DOCKER_ENV_FILE --name=builder -it majodev/go-docker-vscode:${GITHUB_SHA:8}
- name: make tidy
run: docker exec builder make tidy
- name: make build
run: docker exec builder make build
- name: make test
run: docker exec builder make test
- name: Stop container
if: ${{ always() }}
run: docker stop builder
- name: Remove container
if: ${{ always() }}
run: docker rm builder