-
Notifications
You must be signed in to change notification settings - Fork 19
149 lines (132 loc) · 4.58 KB
/
nightly-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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
# Nightly Test Against Open Source Projects Using Xgo
name: Nightly Test
on:
schedule:
- cron: "23 0 * * *"
push:
branches: [ "trigger-nightly-test" ]
workflow_dispatch:
inputs:
dummy:
default: nothing
# 'gin-gonic/gin' ok
# 'fatedier/frp' cannot pass even with go? need to verify
#
# NOTE: use serially job to avoid 'Job Cancelled' which could
# possible be due to memory exhaust
jobs:
test-with-xgo:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- uses: actions/checkout@v4
with:
path: xgo
- name: Switch To Master If From Nightly-Test
run: |
cd xgo
cur_branch=$(git branch --show-current)
if [[ $cur_branch = trigger-nightly-test ]];then
git fetch --depth=1 origin master
git checkout master
fi
- name: Prepare Utility Scripts
run: |
cat > util.sh <<'EOF'
function record_exit_code {
local exit_code=$?
echo "exit code: $exit_code"
echo "$exit_code" > test-exit-code.txt
}
trap 'record_exit_code' EXIT
EOF
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install Xgo Locally
run: |
cd xgo
go install ./cmd/xgo
xgo exec --reset-instrument --log-debug go version
xgo revision
- uses: actions/checkout@v4
with:
repository: gin-gonic/gin
path: gin-gonic/gin
- name: Test gin-gonic/gin
continue-on-error: true
run: |
source util.sh
cd gin-gonic/gin
xgo test -v ./...
- uses: actions/checkout@v4
with:
repository: pocketbase/pocketbase
path: pocketbase/pocketbase
- name: Test pocketbase/pocketbase
continue-on-error: true
run: |
source util.sh
cd pocketbase/pocketbase
xgo test -v ./...
- uses: actions/checkout@v4
with:
repository: gohugoio/hugo
path: gohugoio/hugo
- name: Install Ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899
with:
ruby-version: "2.7"
bundler-cache: true #
- name: Install Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: "3.x"
- name: Install Mage
run: go install github.com/magefile/mage@v1.15.0
- name: Install asciidoctor
uses: reitzig/actions-asciidoctor@03fcc74cd74880b697950c4930c9ec8a67c69ecc
- name: Install docutils
run: |
pip install docutils
rst2html --version
- name: Test gohugoio/hugo
continue-on-error: true
run: |
set -x
echo "---Installing pandoc---"
sudo apt-get update -y
sudo apt-get install -y pandoc
export GO111MODULE=on
export SASS_VERSION=1.63.2
export DART_SASS_SHA_LINUX=3ea33c95ad5c35fda6e9a0956199eef38a398f496cfb8750e02479d7d1dd42af
echo "---Install Dart Sass version ${SASS_VERSION} ---"
curl -LJO "https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-linux-x64.tar.gz";
echo "${DART_SASS_SHA_LINUX} dart-sass-${SASS_VERSION}-linux-x64.tar.gz" | sha256sum -c
tar -xvf "dart-sass-${SASS_VERSION}-linux-x64.tar.gz"
echo "$GOBIN"
echo "$GITHUB_WORKSPACE/dart-sass/" >> $GITHUB_PATH
export PATH="$GITHUB_WORKSPACE/dart-sass:$PATH"
source util.sh
cd gohugoio/hugo
xgo test -v ./...
- uses: actions/checkout@v4
with:
repository: kubernetes/kubernetes
path: kubernetes/kubernetes
- name: Test kubernetes/kubernetes
continue-on-error: true
run: |
source util.sh
cd kubernetes/kubernetes
xgo test -v ./...
- name: Summary
run: |
echo "exit code:"
echo " gin-gonic/gin: $(cat gin-gonic/gin/test-exit-code.txt)"
echo " pocketbase/pocketbase: $(cat pocketbase/pocketbase/test-exit-code.txt)"
echo " gohugoio/hugo: $(cat gohugoio/hugo/test-exit-code.txt)"
echo " kubernetes/kubernetes: $(cat kubernetes/kubernetes/test-exit-code.txt)"