-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (67 loc) · 1.88 KB
/
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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build and test
on:
workflow_dispatch:
pull_request:
branches:
- "main"
paths-ignore:
- ".gitignore"
- ".hadolint.yaml"
- ".pre-commit-config.yaml"
- ".yamllint.yaml"
- "LICENSE"
- "Makefile"
- "README.md"
jobs:
unit_test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^1.19
- name: Launch the unit tests
run: go test
# Integration test disabled due to a GitHub action bug randomly
# not able to fetch the secret value and returning null.
# See https://github.com/orgs/community/discussions/25701#discussioncomment-3248811
# integration_test:
# name: Integration test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# - name: Test the action
# uses: ./
# with:
# package: terraform-graph-beautifier
# repository: pcasteran/terraform-graph-beautifier
# password: ${{ secrets.MY_SECRET_PAT }}
# debug: true
# dry-run: true
#####
build_docker_image:
name: Build the Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- id: build_image
name: Build the Docker image
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ github.repository }}
load: true
- name: Analyze the image efficiency
run: |
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
wagoodman/dive:latest \
--ci \
--lowestEfficiency=0.95 \
--highestUserWastedPercent=0.05 \
${{ github.repository }}