-
-
Notifications
You must be signed in to change notification settings - Fork 35
executable file
·116 lines (89 loc) · 3.24 KB
/
build-test.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
name: Build & Test
on:
workflow_dispatch:
repository_dispatch:
types: [build-test]
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
GOPRIVATE: github.com/slingdata-io/*
jobs:
build-for-test:
if: "! (contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[bump]'))"
runs-on: [self-hosted, linux, ubuntu-20]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.ref }}
- name: Set up GoLang
uses: actions/setup-go@v3
with:
go-version: "1.22"
cache: false
# - uses: actions/cache@v3
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
- name: Configure private token
run: |
git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"
- name: Build
env:
# VERSION: ${{ steps.get_version.outputs.VERSION }}
# VERSION: ${{ github.event.client_payload.version }}
VERSION: ${{ needs.bump.outputs.new_version }}
REF_NAME: ${{ github.ref_name }}
run: |
echo "VERSION -> $VERSION"
echo "REF_NAME -> $REF_NAME"
bash scripts/prep.gomod.sh
bash scripts/build.test.sh $VERSION
test:
if: "! (contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[no test]') || contains(github.event.head_commit.message, '[nt]') || contains(github.event.head_commit.message, '[bump]'))"
needs: [build-for-test]
runs-on: [self-hosted, linux, ubuntu-20]
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: myrotvorets/set-commit-status-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.sha }}
status: pending
- name: Configure Environment
uses: flarco/envkey-action@main
with:
envkey: ${{ secrets.ENVKEY }}
- name: Set up GoLang
uses: actions/setup-go@v3
with:
go-version: "1.22"
cache: false
- name: Configure private token
run: |
git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"
- name: Run Go Tests (sling)
run: |
export DEBUG=''
# Oracle env
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH="$PATH:$ORACLE_HOME/bin"
bash scripts/prep.gomod.sh
bash scripts/test.sh
- name: Run Go Tests (dbio)
run: |
export DEBUG=''
# Oracle env
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH="$PATH:$ORACLE_HOME/bin"
bash scripts/prep.gomod.sh
cd core/dbio
bash scripts/test.sh
- uses: myrotvorets/set-commit-status-action@master
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.sha }}
status: ${{ job.status }}