-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (68 loc) · 2.2 KB
/
plugin-workers.yml
File metadata and controls
78 lines (68 loc) · 2.2 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
name: "Plugin Worker Tests (GitLab)"
on:
repository_dispatch:
types:
- gitlab-push
- gitlab-merge-request
workflow_dispatch:
inputs:
gitlab_branch:
description: 'GitLab branch to test'
required: false
default: 'enterprise'
concurrency:
group: ${{ github.head_ref || github.run_id }}/plugin-workers
cancel-in-progress: true
permissions:
contents: read
jobs:
plugin-workers:
name: "Plugin Worker: ${{ matrix.worker }}"
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- worker: erasure_coding
path: test/plugin_workers/erasure_coding
- worker: ec_repair
path: test/plugin_workers/ec_repair
- worker: vacuum
path: test/plugin_workers/vacuum
- worker: volume_balance
path: test/plugin_workers/volume_balance
steps:
- name: Checkout artifactory repo
uses: actions/checkout@v5
- name: Clone private GitLab repository
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
run: |
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
BRANCH_REF="${{ github.event.client_payload.ref }}"
if [ "$BRANCH_REF" = "null" ] || [ -z "$BRANCH_REF" ]; then
BRANCH="enterprise"
else
BRANCH=$(echo "$BRANCH_REF" | sed 's|refs/heads/||')
fi
else
BRANCH="${{ github.event.inputs.gitlab_branch }}"
if [ -z "$BRANCH" ]; then
BRANCH="enterprise"
fi
fi
echo "Cloning branch: $BRANCH"
git clone -b $BRANCH https://gitlab-ci-token:${GITLAB_TOKEN}@gitlab.com/chrislusf/seaweedfs.git seaweedfs-source
cd seaweedfs-source
echo "Cloned commit: $(git rev-parse HEAD)"
echo "COMMIT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v6
with:
go-version-file: 'seaweedfs-source/go.mod'
cache-dependency-path: 'seaweedfs-source/go.sum'
id: go
- name: Run plugin worker tests
working-directory: seaweedfs-source
run: go test -v ./${{ matrix.path }}