-
Notifications
You must be signed in to change notification settings - Fork 11
[github actions] address test flakiness #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5f98b9f
16df162
c202022
49cd599
c1d59b0
80de8de
49822c0
9d9208f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,39 +14,71 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
os-artifact: [ [ubuntu-latest, linux], [windows-latest, windows], [macos-latest, macos] ] | ||
os-artifact: [ [ubuntu-latest, linux], [windows-latest, windows-gnu], [macos-latest, macos] ] | ||
fundthmcalculus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download workflow artifact | ||
uses: dawidd6/action-download-artifact@v2.14.0 | ||
uses: dawidd6/action-download-artifact@v2.17.0 | ||
with: | ||
workflow: "build-libs.yml" | ||
path: ./libs/${{ matrix.os-artifact[1] }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
name: ${{ matrix.os-artifact[1] }} | ||
- name: Set up Go | ||
- name: Download C header artifact | ||
uses: dawidd6/[email protected] | ||
with: | ||
workflow: "build-libs.yml" | ||
path: ./libs/${{ matrix.os-artifact[1] }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
name: C_header | ||
- name: Set up Go (default) | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.16 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' | ||
- name: Set up Dotnet (docs) | ||
run: | | ||
dotnet tool install DefaultDocumentation.Console -g | ||
shell: pwsh | ||
# Set up Okapi-specific Go runtime. Includes setting GOLANG_LD_PATH env var. | ||
- name: Set up Go (Okapi) | ||
run: | | ||
go version | ||
go install golang.org/x/lint/golint@latest | ||
go install github.com/jstemmer/go-junit-report@latest | ||
go get github.com/posener/goreadme/cmd/goreadme | ||
python ../../devops/build_sdks.py --language=golang | ||
shell: pwsh | ||
working-directory: go/okapi | ||
env: | ||
GO111MODULE: on | ||
- name: Build and Test Golang | ||
run: | | ||
go build - name: Set up Go (Okapi) | ||
run: | | ||
go version | ||
go install golang.org/x/lint/golint@latest | ||
go install github.com/jstemmer/go-junit-report@latest | ||
python ../../devops/build_sdks.py | ||
shell: pwsh | ||
working-directory: go/okapi | ||
- name: Build and Test Golang | ||
run: | | ||
go build | ||
golint | ||
go test -v | go-junit-report > test_output.xml | ||
go test -v -exec "env DYLD_LIBRARY_PATH=${{ env.GOLANG_LD_PATH }}" | go-junit-report > test_output.xml | ||
fundthmcalculus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
shell: pwsh | ||
working-directory: go/okapi | ||
env: | ||
LD_LIBRARY_PATH: "${{ github.workspace }}/go/okapi" | ||
DYLD_FALLBACK_LIBRARY_PATH: "${{ github.workspace }}/go/okapi" | ||
DYLD_LIBRARY_PATH: "${{ github.workspace }}/go/okapi" | ||
LD_LIBRARY_PATH: ${{ env.GOLANG_LD_PATH }} | ||
fundthmcalculus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DYLD_FALLBACK_LIBRARY_PATH: ${{ env.GOLANG_LD_PATH }} | ||
DYLD_LIBRARY_PATH: ${{ env.GOLANG_LD_PATH }} | ||
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }} | ||
- name: Upload Unit Test Results - Golang | ||
if: always() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,16 +28,30 @@ jobs: | |
with: | ||
python-version: 3.9 | ||
- name: Download workflow artifact | ||
uses: dawidd6/action-download-artifact@v2.14.0 | ||
uses: dawidd6/action-download-artifact@v2.17.0 | ||
with: | ||
workflow: "build-libs.yml" | ||
path: ./libs/${{ matrix.os-artifact[1] }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
name: ${{ matrix.os-artifact[1] }} | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
- name: Set up Node (docs) | ||
run: | | ||
npm install groovydoc-to-markdown | ||
shell: pwsh | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' | ||
- name: Set up Dotnet (docs) | ||
run: | | ||
dotnet tool install DefaultDocumentation.Console -g | ||
shell: pwsh | ||
Comment on lines
+37
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dotnet isn't necessary for java. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, I thought we might need to build dotnet docs with all of them since |
||
- name: Build with Gradle | ||
run: | | ||
python ../devops/build_sdks.py | ||
gradle build | ||
python ../devops/build_sdks.py --language=java | ||
gradle build | ||
shell: pwsh | ||
working-directory: java | ||
env: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,13 @@ def get_os_arch_path(extract_dir, windows_path): | |
return copy_from | ||
|
||
|
||
|
||
def set_env_var(name, value): | ||
env_file = os.getenv('GITHUB_ENV') | ||
with open(env_file, "a") as file: | ||
file.write(f"{name}={value}") | ||
|
||
|
||
def copy_okapi_libs(copy_to: str, windows_path='windows'): | ||
okapi_dir = abspath(join(dirname(__file__), '..')) | ||
copy_from = get_os_arch_path(okapi_dir, windows_path) | ||
|
@@ -121,8 +128,10 @@ def build_ruby(args) -> None: | |
|
||
|
||
def build_golang(args) -> None: | ||
# Update version in setup.cfg | ||
# Copy in Okapi libraries to the $GOLANG_LD_PATH directory | ||
golang_dir = abspath(join(get_language_dir('go'), 'okapi')) | ||
set_env_var("GOLANG_LD_PATH", golang_dir) | ||
|
||
# Copy in the binaries | ||
copy_okapi_libs(golang_dir, 'windows-gnu') | ||
|
||
|
@@ -144,7 +153,12 @@ def get_github_version(github_token: str = None) -> str: | |
def build_java_docs(args): | ||
# https://github.com/fchastanet/groovydoc-to-markdown | ||
# npm install in the root of sdk | ||
subprocess.Popen(r'node ./node_modules/groovydoc-to-markdown/src/doc2md.js ./java java ./docs/reference/java', cwd=get_sdk_dir() ).wait() | ||
subprocess.Popen( | ||
[ | ||
'node', './node_modules/groovydoc-to-markdown/src/doc2md.js', | ||
'./java', 'java', './docs/reference/java' | ||
], cwd=get_sdk_dir() | ||
).wait() | ||
|
||
|
||
def build_dotnet_docs(args) -> None: | ||
|
@@ -153,20 +167,32 @@ def build_dotnet_docs(args) -> None: | |
assembly_file = './dotnet/Library/Okapi/bin/Debug/net6.0/okapi.dll' | ||
output_doc_folder = './docs/reference/dotnet' | ||
clean_dir(abspath(join(get_sdk_dir(), output_doc_folder))) | ||
subprocess.Popen(f"defaultdocumentation --AssemblyFilePath {assembly_file} --OutputDirectoryPath {output_doc_folder} --FileNameMode Name --GeneratedPages Namespaces", | ||
cwd=get_sdk_dir()).wait() | ||
subprocess.Popen( | ||
[ | ||
"defaultdocumentation", | ||
"--AssemblyFilePath", assembly_file, | ||
"--OutputDirectoryPath", output_doc_folder, | ||
"--FileNameMode", "Name", | ||
"--GeneratedPages", "Namespaces", | ||
], | ||
cwd=get_sdk_dir() | ||
).wait() | ||
|
||
|
||
def build_go_docs(args): | ||
# https://github.com/posener/goreadme | ||
# go get github.com/posener/goreadme/cmd/goreadme | ||
goreadme_args = r'-recursive -functions -methods -types -variabless' # Yes, that's a duplicated s, it's on purpose. | ||
goreadme_args = ['-recursive', '-functions', '-methods', '-types', '-variabless'] # Yes, that's a duplicated s, it's on purpose. | ||
doc_path = abspath(join(get_language_dir('docs'), 'reference', 'go')) | ||
|
||
def write_doc_file(input_path: str, output_file: str): | ||
logging.info(f"goreadme(input={input_path}, output={output_file})") | ||
print(f"goreadme(input={input_path}, output={output_file})") | ||
with open(join(doc_path, f'{output_file}.md'), 'w') as output: | ||
subprocess.Popen(rf'goreadme {goreadme_args}', cwd=input_path, stdout=output).wait() | ||
subprocess.Popen( | ||
['goreadme', *goreadme_args], | ||
cwd=input_path, stdout=output | ||
).wait() | ||
# Handle the subdirectories | ||
for sub_folder in glob.glob(join(input_path, '**')): | ||
if isdir(sub_folder): | ||
|
@@ -193,14 +219,14 @@ def main(): | |
build_python(args) | ||
if build_all or 'java' in langs_to_build: | ||
build_java(args) | ||
build_java_docs(args) | ||
if build_all or 'ruby' in langs_to_build: | ||
build_ruby(args) | ||
if build_all or 'golang' in langs_to_build: | ||
build_golang(args) | ||
build_go_docs(args) | ||
if build_all or 'docs' in langs_to_build: | ||
build_java_docs(args) | ||
build_dotnet_docs(args) | ||
Comment on lines
228
to
229
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should switch this to |
||
build_go_docs(args) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
Uh oh!
There was an error while loading. Please reload this page.