Skip to content

Commit 48d0f98

Browse files
authored
[github actions] address test flakiness (#360)
* [github actions] upgrade action-download-artifact * [github actions] download Go C_header file * [golang] add comment strings to appease aggressive linter * fix LD path getting/setting * don't build docs by default * re-introduce build docs by default * cleanup: rm whitespace change
1 parent faaec92 commit 48d0f98

16 files changed

Lines changed: 124 additions & 29 deletions

.github/workflows/build-dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Checkout
2121
uses: actions/checkout@v1
2222
- name: Download workflow artifact
23-
uses: dawidd6/action-download-artifact@v2.14.0
23+
uses: dawidd6/action-download-artifact@v2.17.0
2424
with:
2525
workflow: "build-libs.yml"
2626
path: ./libs

.github/workflows/build-golang.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,71 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
os-artifact: [ [ubuntu-latest, linux], [windows-latest, windows], [macos-latest, macos] ]
17+
os-artifact: [ [ubuntu-latest, linux], [windows-latest, windows-gnu], [macos-latest, macos] ]
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Download workflow artifact
21-
uses: dawidd6/action-download-artifact@v2.14.0
21+
uses: dawidd6/action-download-artifact@v2.17.0
2222
with:
2323
workflow: "build-libs.yml"
2424
path: ./libs/${{ matrix.os-artifact[1] }}
2525
github_token: ${{ secrets.GITHUB_TOKEN }}
2626
name: ${{ matrix.os-artifact[1] }}
27-
- name: Set up Go
27+
- name: Download C header artifact
28+
uses: dawidd6/[email protected]
29+
with:
30+
workflow: "build-libs.yml"
31+
path: ./libs/${{ matrix.os-artifact[1] }}
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
name: C_header
34+
- name: Set up Go (default)
2835
uses: actions/setup-go@v2
2936
with:
3037
go-version: ^1.16
3138
- name: Set up Python
3239
uses: actions/setup-python@v2
3340
with:
3441
python-version: 3.9
42+
- uses: actions/setup-dotnet@v1
43+
with:
44+
dotnet-version: '6.0.x'
45+
- name: Set up Dotnet (docs)
46+
run: |
47+
dotnet tool install DefaultDocumentation.Console -g
48+
shell: pwsh
49+
# Set up Okapi-specific Go runtime. Includes setting GOLANG_LD_PATH env var.
50+
- name: Set up Go (Okapi)
51+
run: |
52+
go version
53+
go install golang.org/x/lint/golint@latest
54+
go install github.com/jstemmer/go-junit-report@latest
55+
go get github.com/posener/goreadme/cmd/goreadme
56+
python ../../devops/build_sdks.py --language=golang
57+
shell: pwsh
58+
working-directory: go/okapi
59+
env:
60+
GO111MODULE: on
3561
- name: Build and Test Golang
62+
run: |
63+
go build - name: Set up Go (Okapi)
3664
run: |
3765
go version
3866
go install golang.org/x/lint/golint@latest
3967
go install github.com/jstemmer/go-junit-report@latest
4068
python ../../devops/build_sdks.py
69+
shell: pwsh
70+
working-directory: go/okapi
71+
- name: Build and Test Golang
72+
run: |
4173
go build
4274
golint
43-
go test -v | go-junit-report > test_output.xml
75+
go test -v -exec "env DYLD_LIBRARY_PATH=${{ env.GOLANG_LD_PATH }}" | go-junit-report > test_output.xml
4476
shell: pwsh
4577
working-directory: go/okapi
4678
env:
47-
LD_LIBRARY_PATH: "${{ github.workspace }}/go/okapi"
48-
DYLD_FALLBACK_LIBRARY_PATH: "${{ github.workspace }}/go/okapi"
49-
DYLD_LIBRARY_PATH: "${{ github.workspace }}/go/okapi"
79+
LD_LIBRARY_PATH: ${{ env.GOLANG_LD_PATH }}
80+
DYLD_FALLBACK_LIBRARY_PATH: ${{ env.GOLANG_LD_PATH }}
81+
DYLD_LIBRARY_PATH: ${{ env.GOLANG_LD_PATH }}
5082
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
5183
- name: Upload Unit Test Results - Golang
5284
if: always()

.github/workflows/build-java.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,30 @@ jobs:
2828
with:
2929
python-version: 3.9
3030
- name: Download workflow artifact
31-
uses: dawidd6/action-download-artifact@v2.14.0
31+
uses: dawidd6/action-download-artifact@v2.17.0
3232
with:
3333
workflow: "build-libs.yml"
3434
path: ./libs/${{ matrix.os-artifact[1] }}
3535
github_token: ${{ secrets.GITHUB_TOKEN }}
3636
name: ${{ matrix.os-artifact[1] }}
37+
- uses: actions/setup-node@v2
38+
with:
39+
node-version: '14'
40+
- name: Set up Node (docs)
41+
run: |
42+
npm install groovydoc-to-markdown
43+
shell: pwsh
44+
- uses: actions/setup-dotnet@v1
45+
with:
46+
dotnet-version: '6.0.x'
47+
- name: Set up Dotnet (docs)
48+
run: |
49+
dotnet tool install DefaultDocumentation.Console -g
50+
shell: pwsh
3751
- name: Build with Gradle
3852
run: |
39-
python ../devops/build_sdks.py
40-
gradle build
53+
python ../devops/build_sdks.py --language=java
54+
gradle build
4155
shell: pwsh
4256
working-directory: java
4357
env:

.github/workflows/build-python.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,24 @@ jobs:
3434
cache: 'pip'
3535

3636
- name: Download workflow artifact
37-
uses: dawidd6/action-download-artifact@v2.14.0
37+
uses: dawidd6/action-download-artifact@v2.17.0
3838
with:
3939
workflow: "build-libs.yml"
4040
path: ./libs/${{ matrix.os-artifact[1] }}
4141
github_token: ${{ secrets.GITHUB_TOKEN }}
4242
name: ${{ matrix.os-artifact[1] }}
43-
43+
- uses: actions/setup-dotnet@v1
44+
with:
45+
dotnet-version: '6.0.x'
46+
- name: Set up Dotnet (docs)
47+
run: |
48+
dotnet tool install DefaultDocumentation.Console -g
49+
shell: pwsh
4450
- name: Build, Test, Pack
4551
run: |
4652
python -m pip install --upgrade --upgrade-strategy eager -r requirements.txt
4753
python -m pip install pytest pytest-cov
48-
python ../devops/build_sdks.py
54+
python ../devops/build_sdks.py --language=python
4955
python -m pytest --cache-clear ./tests --junitxml=test_output.xml --cov=.
5056
shell: pwsh
5157
working-directory: python

.github/workflows/build-ruby.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,25 @@ jobs:
3232
cache: 'pip'
3333

3434
- name: Download workflow artifact
35-
uses: dawidd6/action-download-artifact@v2.14.0
35+
uses: dawidd6/action-download-artifact@v2.17.0
3636
with:
3737
workflow: "build-libs.yml"
3838
path: ./libs/${{ matrix.os-artifact[1] }}
3939
github_token: ${{ secrets.GITHUB_TOKEN }}
4040
name: ${{ matrix.os-artifact[1] }}
41+
- uses: actions/setup-dotnet@v1
42+
with:
43+
dotnet-version: '6.0.x'
44+
- name: Set up Dotnet (docs)
45+
run: |
46+
dotnet tool install DefaultDocumentation.Console -g
47+
shell: pwsh
4148
- name: Build and run tests
4249
run: |
4350
gem install bundler
4451
gem install rspec
4552
bundle install
46-
python ../devops/build_sdks.py
53+
python ../devops/build_sdks.py --language=ruby
4754
bundle exec rake
4855
rake test
4956
exit 0

.github/workflows/release-dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
submodules: "true"
2525
- name: Download workflow artifact
26-
uses: dawidd6/action-download-artifact@v2.14.0
26+
uses: dawidd6/action-download-artifact@v2.17.0
2727
with:
2828
workflow: "build-libs.yml"
2929
path: ./libs

.github/workflows/release-java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
java-version: '15'
3232
distribution: 'adopt'
3333
- name: Download workflow artifact
34-
uses: dawidd6/action-download-artifact@v2.14.0
34+
uses: dawidd6/action-download-artifact@v2.17.0
3535
with:
3636
workflow: "build-libs.yml"
3737
path: ./libs

.github/workflows/release-libs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Upload libs.zip artifact
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: dawidd6/action-download-artifact@v2.14.0
13+
- uses: dawidd6/action-download-artifact@v2.17.0
1414
with:
1515
workflow: "build-libs.yml"
1616
path: ./libs

.github/workflows/release-ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
ruby-version: 2.7
3232
- name: Download workflow artifact
33-
uses: dawidd6/action-download-artifact@v2.14.0
33+
uses: dawidd6/action-download-artifact@v2.17.0
3434
with:
3535
workflow: "build-libs.yml"
3636
path: ./libs

.github/workflows/release-swift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/checkout@v1
2323

2424
- name: Download workflow artifact
25-
uses: dawidd6/action-download-artifact@v2.14.0
25+
uses: dawidd6/action-download-artifact@v2.17.0
2626
with:
2727
workflow: "build-libs.yml"
2828
path: ./libs

0 commit comments

Comments
 (0)