Skip to content

Commit b5e7eb7

Browse files
Build + Push cov-diff curing CI runs
CI currently spends 30s building this every run
1 parent 02f4237 commit b5e7eb7

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

.github/workflows/integration.yaml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,59 @@ name: Integration Test
22

33
on:
44
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
env:
11+
AWS_DEFAULT_REGION: us-east-1
512

613
jobs:
714
build:
815
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
id-token: write
19+
920
steps:
10-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1122
with:
1223
fetch-depth: 0
1324

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+
1458
- name: run tests
1559
run: |
1660
go test ./... -coverprofile=coverage.out

0 commit comments

Comments
 (0)