-
Notifications
You must be signed in to change notification settings - Fork 32
86 lines (77 loc) · 2.57 KB
/
cesar.yaml
File metadata and controls
86 lines (77 loc) · 2.57 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
name: CESARt
on:
pull_request:
types: [ labeled ]
env:
ENGINE_VERSION: ${{ vars.ENGINE_VERSION }}
PLATFORM: "LINUX_X64"
ENGINE: "2ms"
REMOVE_HISTORY: "true"
jobs:
build:
if: (github.event.label.name == 'cesar' && github.event.pull_request.mergeable == true)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
path: 2ms
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 2ms/go.mod
cache-dependency-path: 2ms/go.sum
cache: true
- name: Build 2ms Binary
env:
CGO_ENABLED: 0
GOOS: linux
GOARCH: amd64
run: |
cd $GITHUB_WORKSPACE/2ms
go build -buildvcs=false -ldflags "-s -w" -a -o $GITHUB_WORKSPACE/2ms/dist/2ms main.go
chmod +x $GITHUB_WORKSPACE/2ms/dist/2ms
- name: Create Metadata File
env:
PR_NUMBER: ${{ github.event.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
ACTOR: ${{ github.actor }}
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
run: |
COMMIT_TIMESTAMP=$(git -C "$GITHUB_WORKSPACE/2ms" log -1 --format=%ct)
METADATA_PATH="$GITHUB_WORKSPACE/pr-metadata.json"
CURR_TIMESTAMP=$(date +%s)
echo '{
"seq": "'"${CURR_TIMESTAMP}"'",
"tag": "'"${PR_NUMBER}"'",
"comment": "'"${PR_TITLE}"'",
"commit": "'"${PR_HEAD_SHA}"'",
"owner": "'"${ACTOR}"'",
"branch": "'"${HEAD_REF}"'",
"engine": "'"${ENGINE}"'",
"platform": "'"${PLATFORM}"'",
"version": "'"${ENGINE_VERSION}"'",
"forkSeq": "'"${CURR_TIMESTAMP}"'",
"forkBranch": "'"${BASE_REF}"'",
"removeHistory" : "'"${REMOVE_HISTORY}"'"
}' > "$METADATA_PATH"
- name: Save 2ms
uses: actions/upload-artifact@v4
with:
name: 2ms
path: |
2ms/dist/
retention-days: 1
- name: Pr parameters
uses: actions/upload-artifact@v4
with:
name: Metadata
path: ${{ github.workspace }}/pr-metadata.json
retention-days: 1
ci-projects:
needs: build
uses: ./.github/workflows/run-projects.yaml
with:
machines-count: 10
secrets: inherit