@@ -2,15 +2,59 @@ name: Integration Test
2
2
3
3
on :
4
4
pull_request :
5
+ push :
6
+ branches :
7
+ - main
8
+ workflow_dispatch :
9
+
10
+ env :
11
+ AWS_DEFAULT_REGION : us-east-1
5
12
6
13
jobs :
7
14
build :
8
15
runs-on : ubuntu-latest
16
+ permissions :
17
+ contents : read
18
+ id-token : write
19
+
9
20
steps :
10
- - uses : actions/checkout@v3
21
+ - uses : actions/checkout@v4
11
22
with :
12
23
fetch-depth : 0
13
24
25
+ - name : Configure AWS Credentials
26
+ uses : aws-actions/configure-aws-credentials@v4
27
+ with :
28
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
29
+
30
+ - name : Login to Amazon ECR
31
+ id : login-ecr
32
+ uses : aws-actions/amazon-ecr-login@v2
33
+
34
+ - name : Set up Docker Buildx
35
+ uses : docker/setup-buildx-action@v3
36
+
37
+ - name : Determine ECR image tags
38
+ id : meta
39
+ uses : docker/metadata-action@v5
40
+ with :
41
+ images : ${{ steps.login-ecr.outputs.registry }}/cov-diff-action
42
+ tags : |
43
+ type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
44
+ type=sha
45
+ type=semver,pattern=v{{version}},event=tag
46
+
47
+ - name : Build and Push Docker image to ECR
48
+ id : build_and_push
49
+ uses : docker/build-push-action@v6
50
+ with :
51
+ context : .
52
+ file : ./Dockerfile
53
+ push : ${{ github.event_name != 'pull_request' }}
54
+ tags : ${{ steps.meta.outputs.tags }}
55
+ cache-from : type=gha,scope=${{ github.workflow }}
56
+ cache-to : type=gha,mode=max,scope=${{ github.workflow }}
57
+
14
58
- name : run tests
15
59
run : |
16
60
go test ./... -coverprofile=coverage.out
0 commit comments