-
Notifications
You must be signed in to change notification settings - Fork 31
49 lines (42 loc) · 1.28 KB
/
ci-pr-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
name: Building and test for PR
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 8
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install check tools
shell: bash
run: |
set -o xtrace
git clone --branch yun --depth 4 https://github.com/yousong/tools && cd tools
go build ./cmd/goimports && sudo cp goimports /usr/bin/ && cd .. && rm -rf tools
git clone --depth 4 https://github.com/yousong/y18n && cd y18n
go build . && sudo cp y18n /usr/bin && cd .. && rm -rf y18n
- name: Test and build
shell: bash
run: |
set -o xtrace
export GO111MODULE=on
make test
targets="$(find cmd -mindepth 1 -maxdepth 1 -type d | grep -v cmd/host-image)"
echo $targets | tr ' ' '\n'
make -j2 $targets
ls -lh _output/bin
# set -o xtrace
# workdir="$HOME/go/src/yunion.io/x"
# mkdir -p "$workdir"
# mv "$HOME/work/cloudmux/cloudmux" "$workdir/"
#
# export GOPATH="$HOME/go"
# export GO111MODULE=on
# cd "$workdir/cloudmux"
# make test