-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.31 KB
/
testing-pull-request.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
name: Testing code - Pull Request
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test-app:
name: Test Application
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run GolangCI-Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
- name: Test application
run: go test -v ./...
- name: Capture git tag
id: vars
run: |
echo "tag=$GITHUB_SHA" >> $GITHUB_OUTPUT
- name: Replace version in plugin.yaml
run: |
yq e ".version = \"${{ steps.vars.outputs.tag }}\"" plugin.yaml.tpl > plugin.yaml
- name: Assert with yq that the tag has changed
run: |
yq e ".version" plugin.yaml | grep -q "$GITHUB_SHA"
echo "Tag has been updated to $(yq e ".version" plugin.yaml)"
- name: Dry-run goreleaser application
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --snapshot --skip=publish --clean