-
Notifications
You must be signed in to change notification settings - Fork 11
171 lines (143 loc) · 4.96 KB
/
tests.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
name: Run UTs on ${{ matrix.ruby_version }} + ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby_version: ['3.0', '3.1', '3.2', '3.3']
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: debug
run: |
node -e "console.log(JSON.stringify(process.env, null, ' '))"
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Run tests
run: |
bundle install
bundle exec rake spec
fts:
name: Run FTs on ${{ matrix.ruby_version }} + ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: tests
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
ruby_version: ['3.0', '3.1', '3.2', '3.3']
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup env
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$COMMIT_HASH = node -e "console.log((process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF).replace(/refs\/heads\//,''))"
$ruby_plugin_path = (pwd).Path
echo "RUBY_PLUGIN_BRANCH=$COMMIT_HASH" >> $env:GITHUB_ENV
echo "LOCAL_RUBY_PLUGIN_PATH=$ruby_plugin_path" >> $env:GITHUB_ENV
- name: Setup env
if: matrix.os != 'windows-latest'
run: |
export COMMIT_HASH=`node -e "console.log((process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF).replace(/refs\/heads\//,''))"`
echo "RUBY_PLUGIN_BRANCH=$COMMIT_HASH" >> $GITHUB_ENV
echo "LOCAL_RUBY_PLUGIN_PATH=$(pwd)" >> $GITHUB_ENV
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- uses: getgauge/setup-gauge@master
with:
gauge-version: master
- name: Install gauge ruby
run: |
go run -mod=readonly build/make.go
go run -mod=readonly build/make.go --install
- name: Run tests
run: |
git clone --depth=1 https://github.com/getgauge/gauge-tests
cd gauge-tests
gauge install
gauge -v
./gradlew clean rubyFT
- uses: actions/upload-artifact@master
if: failure() || cancelled()
with:
name: fts-logs-${{ matrix.os }}-ruby-${{ matrix.ruby_version }}
path: gauge-tests/logs
lsp-tests:
name: Run lsp on ${{ matrix.ruby_version }} + ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby_version: ['3.0', '3.1', '3.2', '3.3']
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup env
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$COMMIT_HASH = node -e "console.log((process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF).replace(/refs\/heads\//,''))"
$ruby_plugin_path = (pwd).Path
echo "RUBY_PLUGIN_BRANCH=$COMMIT_HASH" >> $env:GITHUB_ENV
echo "LOCAL_RUBY_PLUGIN_PATH=$ruby_plugin_path" >> $env:GITHUB_ENV
- name: Setup env
if: matrix.os != 'windows-latest'
run: |
export COMMIT_HASH=`node -e "console.log((process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF).replace(/refs\/heads\//,''))"`
echo "RUBY_PLUGIN_BRANCH=$COMMIT_HASH" >> $GITHUB_ENV
echo "LOCAL_RUBY_PLUGIN_PATH=$(pwd)" >> $GITHUB_ENV
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: getgauge/setup-gauge@master
with:
gauge-version: master
- name: Install gauge ruby
run: |
go run -mod=readonly build/make.go
go run -mod=readonly build/make.go --install
- name: Prepare lsp tests
run: |
git clone --depth=1 https://github.com/getgauge/gauge-lsp-tests
cd gauge-lsp-tests
npm install
gauge install
- name: Run lsp tests
run: |
cd gauge-lsp-tests
gauge -v
gauge run --tags='!knownIssue & (actions_on_project_load | actions_on_file_edit)' --env=ruby-wd
- uses: actions/upload-artifact@master
if: failure() || cancelled()
with:
name: lsp-logs-${{ matrix.os }}-ruby-${{ matrix.ruby_version }}
path: gauge-lsp-tests/logs