-
Notifications
You must be signed in to change notification settings - Fork 546
117 lines (108 loc) · 4.31 KB
/
dest_bigquery.yml
File metadata and controls
117 lines (108 loc) · 4.31 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Destination Plugin BigQuery Workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- 'plugins/destination/bigquery/**'
- '.github/workflows/dest_bigquery.yml'
push:
branches:
- main
paths:
- 'plugins/destination/bigquery/**'
- '.github/workflows/dest_bigquery.yml'
permissions:
contents: read
jobs:
plugins-destination-bigquery:
timeout-minutes: 10
name: 'plugins/destination/bigquery'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./plugins/destination/bigquery
# Add "id-token" with the intended permissions.
permissions:
id-token: 'write' # This required for OIDC
contents: 'read' # This is required for actions/checkout@v3
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 2
- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db' # v3.0.1
- name: Set up Go 1.x
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: plugins/destination/bigquery/go.mod
cache: false
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-test-destination-bigquery-${{ hashFiles('plugins/destination/bigquery/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-test-destination-bigquery-
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
version: v2.11.4
working-directory: plugins/destination/bigquery
args: '--config ../../.golangci.yml'
- 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: Authenticate to Google Cloud
uses: 'google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093' # v3
with:
workload_identity_provider: 'projects/151868820337/locations/global/workloadIdentityPools/integration-test-pool/providers/integration-test-provider'
service_account: 'integration-service-account@cq-integration-tests.iam.gserviceaccount.com'
- name: Build
run: go build .
- name: Test
run: make test
env:
BIGQUERY_PROJECT_ID: ${{ secrets.BIGQUERY_TEST_PROJECT_ID }}
BIGQUERY_DATASET_ID: ${{ secrets.BIGQUERY_TEST_DATASET_ID }}
BIGQUERY_DATASET_LOCATION: us-west1
validate-fips:
timeout-minutes: 30
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./plugins/destination/bigquery
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Go 1.x
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: plugins/destination/bigquery/go.mod
cache: false
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-validate-plugin-fips-cache-destination-bigquery-${{ hashFiles('plugins/destination/bigquery/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-validate-plugin-fips-cache-destination-bigquery-
- name: Run package command
env:
GOFLAGS: "-tags=fipsEnabled"
run: |
rm -rf docs/tables.md
go run main_fips.go package -m "chore: Test FIPS" "v1.0.0" .
- name: Unzip package artifacts
run: |
unzip -o dist/plugin-bigquery-v1.0.0-linux-amd64.zip
chmod +x plugin-bigquery-v1.0.0-linux-amd64
./plugin-bigquery-v1.0.0-linux-amd64 --version 2>&1 | grep -E 'FIPS enabled: true'