-
Notifications
You must be signed in to change notification settings - Fork 13
125 lines (108 loc) · 3.23 KB
/
dance.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
117
118
119
120
121
122
123
124
125
---
name: Dance
on:
push:
branches:
- main
pull_request:
types:
- unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild
- opened
- reopened
- synchronize
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
jobs:
dance:
name: dance
runs-on:
labels: ubuntu-22.04
timeout-minutes: 120
# 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
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready')
strategy:
fail-fast: false
matrix:
db:
- ferretdb
- mongodb
test:
- dbaas_core
- diff
- dotnet-example
- dotnet-example-auth
- java-example
- java-example-auth
- python-example
- python-example-auth
- mongo
- mongo-go-driver
- mongo-tools
- ycsb-workloada
- ycsb-workloadc
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: dance
# set up Python build environment
- name: Install Python dependencies
run: |
pip3 install pymongo
- name: Install Task
run: go generate -x
working-directory: tools
- name: Start environment
run: bin/task env-up-detach
env:
FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main
DB: ${{ matrix.db }}
- name: Run init
run: bin/task init
# The step that creates or updates the environment variable does not have access to the new value,
# but all subsequent steps in a job will have access.
- name: Set GITHUB_ENV
run: |
if [[ ${{ matrix.test == 'dbaas_core' }} ]]; then
echo "WORKERS=1" >> $GITHUB_ENV
fi
- name: Dance!
run: bin/task dance
env:
DB: ${{ matrix.db }}
TEST: ${{ matrix.test }}
WORKERS: ${{ env.WORKERS }}
- 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@v3
with:
name: compose-logs-${{ matrix.db }}-${{ matrix.test }}
path: compose-logs.zip
retention-days: 1
# 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