forked from cloudquery/cloudquery
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (79 loc) · 2.59 KB
/
scaffold.yml
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
name: Scaffold Workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- "scaffold/**"
- ".github/workflows/scaffold.yml"
push:
branches:
- main
paths:
- "scaffold/**"
- ".github/workflows/scaffold.yml"
jobs:
scaffold:
timeout-minutes: 30
name: "scaffold"
runs-on: large-ubuntu-monorepo
defaults:
run:
working-directory: ./scaffold
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version-file: scaffold/go.mod
cache: true
cache-dependency-path: scaffold/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
working-directory: cli
skip-pkg-cache: true
skip-build-cache: true
- name: Build
run: go build .
- name: Test
run: make test
validate-release:
timeout-minutes: 30
runs-on: large-ubuntu-monorepo
env:
CGO_ENABLED: 0
steps:
- name: Checkout
if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push'
uses: actions/checkout@v3
- uses: actions/cache@v3
if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push'
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-1.20.5-release-cache-${{ hashFiles('scaffold/go.sum') }}
restore-keys: |
${{ runner.os }}-go-1.20.5-release-cache-scaffold
- name: Set up Go
if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push'
uses: actions/setup-go@v3
with:
go-version-file: scaffold/go.mod
- name: Install GoReleaser
if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push'
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser-pro
version: latest
install-only: true
- name: Run GoReleaser Dry-Run
if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push'
run: goreleaser release --snapshot --clean --skip-validate --skip-publish --skip-sign -f ./scaffold/.goreleaser.yaml
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}