forked from cloudquery/cloudquery
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (85 loc) · 3.11 KB
/
source_digitalocean.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
83
84
85
86
87
name: Source Plugin DigitalOcean Workflow
on:
pull_request:
paths:
- "plugins/source/digitalocean/**"
- ".github/workflows/source_digitalocean.yml"
push:
branches:
- main
paths:
- "plugins/source/digitalocean/**"
- ".github/workflows/source_digitalocean.yml"
jobs:
plugins-source-digitalocean:
timeout-minutes: 30
name: "plugins/source/digitalocean"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./plugins/source/digitalocean
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version-file: plugins/source/digitalocean/go.mod
cache: true
cache-dependency-path: plugins/source/digitalocean/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
working-directory: plugins/source/digitalocean
args: "--config ../../.golangci.yml"
skip-pkg-cache: true
skip-build-cache: true
- name: Get dependencies
run: go get -t -d ./...
- name: gen
if: github.event_name == 'pull_request'
run: make gen
- name: Fail if generation updated files
if: github.event_name == 'pull_request'
run: test "$(git status -s | wc -l)" -eq 0 || (git status -s; exit 1)
- name: Build
run: go build .
- name: Test
run: make test
validate-release:
timeout-minutes: 30
runs-on: ubuntu-latest
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.19.5-release-cache-${{ hashFiles('plugins/source/digitalocean/go.sum') }}
restore-keys: |
${{ runner.os }}-go-1.19.5-release-cache-plugins-source-digitalocean
- 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: plugins/source/digitalocean/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 ./plugins/source/digitalocean/.goreleaser.yaml
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}