-
Notifications
You must be signed in to change notification settings - Fork 25
85 lines (71 loc) · 2.48 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
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.24.0@sha256:309c71f542b53fcb5fbc9042ec45cbab881a3b310c3a57b843d8ffe979bfa951
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 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: test docker build (no browser)
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@f0dd3480fa3e657d741dd9e8d9b999cfb61fc713
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@f0dd3480fa3e657d741dd9e8d9b999cfb61fc713
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