-
Notifications
You must be signed in to change notification settings - Fork 13
116 lines (97 loc) · 3.26 KB
/
dance-trust.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
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
---
# Tests that need access to secrets.
name: Dance trusted
on:
pull_request_target:
types:
# not for "labeled" to prevent two builds for "labeled" and "unlabeled" when labels are changed
- unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild
- opened
- reopened
- synchronize
push:
branches:
- main
schedule:
- cron: "12 3 * * *" # after FerretDB's Docker workflow
env:
GOPATH: /home/runner/go
GOCACHE: /home/runner/go/cache
GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint
GOMODCACHE: /home/runner/go/mod
GOPROXY: https://proxy.golang.org
GOTOOLCHAIN: local
jobs:
dance:
name: dance
# https://www.ubicloud.com/docs/github-actions-integration/price-performance
# https://www.ubicloud.com/docs/about/pricing#github-actions
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#per-minute-rates
runs-on: ubicloud-standard-4
timeout-minutes: 30
# Do not run this job in parallel for any PR change or branch push
# to save some resources.
concurrency:
group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
# disable for now
if: false
# if: >
# github.event_name != 'pull_request_target' ||
# (
# contains(github.event.pull_request.labels.*.name, 'trust') &&
# !contains(github.event.pull_request.labels.*.name, 'not ready')
# )
strategy:
fail-fast: false
matrix:
db:
- ferretdb-postgresql
- ferretdb-sqlite
- mongodb
test:
- enmeshed-runtime
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: dance
- name: Install Task
run: go generate -x
working-directory: tools
- name: Start environment
run: bin/task env-up-detach DB=${{ matrix.db }}
env:
FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main
POSTGRES_IMAGE: postgres:16.4
- name: Run init
run: bin/task init
- name: Dance!
run: bin/task dance DB=${{ matrix.db }} TEST=${{ matrix.test }} PARALLEL=10
env:
NMSHD_TEST_BASEURL: ${{ secrets.NMSHD_TEST_BASEURL }}
NMSHD_TEST_CLIENTID: ${{ secrets.NMSHD_TEST_CLIENTID }}
NMSHD_TEST_CLIENTSECRET: ${{ secrets.NMSHD_TEST_CLIENTSECRET }}
- name: Collect logs
if: failure()
run: |
bin/task env-logs-collect > /tmp/compose-logs.txt
- name: Compress logs before upload
if: failure()
run: zip -q -9 compose-logs.zip /tmp/compose-logs.txt
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: compose-logs-${{ matrix.db }}-${{ matrix.test }}
path: compose-logs.zip
retention-days: 3
# ignore `go mod tidy` being applied to the Go driver, etc
- name: Check dirty
run: |
git status --ignore-submodules=none
git diff --ignore-submodules=all --exit-code