-
Notifications
You must be signed in to change notification settings - Fork 25
88 lines (73 loc) · 2.56 KB
/
validate_pr.yaml
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
79
80
81
82
83
84
85
86
87
88
name: validate pull request
on:
pull_request:
branches:
- main
jobs:
validate:
name: validate
strategy:
matrix:
runner: [ ubuntu-latest, github-hosted-ubuntu-arm64 ]
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/grafana/grafana-build-tools:v0.34.0@sha256:2d2b61738952e4934df01457638cf78da6178e763db152cfde0489e99bc14eeb
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up global git config
run: |
# The directory where the code has been checked out ends up belonging
# to a different user, so git complains about permissions. Indicate
# that it's safe to ignore.
git config --global --add safe.directory '*'
- name: Restore Go cache
id: restore-go-cache
uses: ./.github/actions/go-cache-restore
- name: build info
id: build-info
run: |
echo "os=$(go env GOOS)" >> "$GITHUB_OUTPUT"
echo "arch=$(go env GOARCH)" >> "$GITHUB_OUTPUT"
- name: ensure dependencies are up-to-date
run: |
make deps
scripts/enforce-clean
- name: version
id: version
run: |
make version
echo "value=$(cat dist/version)" >> "$GITHUB_OUTPUT"
- name: build
run: make build-native
- name: lint
run: make lint
- name: test
run: make test
- name: build packages
run: make package-native
- name: test docker build (no browser)
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@7d18a46aafb8b875ed76a0bc98852d74b91e7f91 # v1.0.0
with:
push: false
platforms: |-
${{ steps.build-info.outputs.os }}/${{ steps.build-info.outputs.arch }}
tags: |-
type=raw,value=${{ steps.version.outputs.value }}
type=sha,prefix=sha-,format=short
latest
target: release
- name: test docker build (browser)
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@7d18a46aafb8b875ed76a0bc98852d74b91e7f91 # v1.0.0
with:
push: false
platforms: |-
${{ steps.build-info.outputs.os }}/${{ steps.build-info.outputs.arch }}
tags: |-
type=raw,value=${{ steps.version.outputs.value }}-browser
type=sha,prefix=sha-,suffix=-browser,format=short
latest-browser
target: with-browser