Skip to content

Commit 32a6770

Browse files
authored
DYN-8502: Modify cicd for public github (#1)
* Modify cicd for public github * Haven't merged 3.13 yet * Remove custom nuget.config * Disable perf tests * ARM available publicly? * Different arm id? * Use default python on ARM * .net framework issue fixed in .NET 9? * Specify framework? * Disable ARM for now
1 parent 11b56b4 commit 32a6770

7 files changed

Lines changed: 171 additions & 139 deletions

File tree

.github/workflows/ARM.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
7+
# pull_request:
88

99
jobs:
1010
build-test-arm:

.github/workflows/docs.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- dynamo_py3
7+
pull_request:
8+
9+
jobs:
10+
build-test:
11+
name: Build and Test
12+
runs-on: ${{ matrix.os.instance }}
13+
timeout-minutes: 15
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os:
19+
- category: windows
20+
platform: x86
21+
instance: windows-latest
22+
23+
- category: windows
24+
platform: x64
25+
instance: windows-latest
26+
27+
- category: ubuntu
28+
platform: x64
29+
instance: ubuntu-22.04
30+
31+
- category: macos
32+
platform: x64
33+
instance: macos-13
34+
35+
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
36+
37+
steps:
38+
- name: Set Environment on macOS
39+
uses: maxim-lobanov/setup-xamarin@v1
40+
if: ${{ matrix.os.category == 'macos' }}
41+
with:
42+
mono-version: latest
43+
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
47+
- name: Setup .NET
48+
uses: actions/setup-dotnet@v1
49+
with:
50+
dotnet-version: '6.0.x'
51+
52+
- name: Set up Python ${{ matrix.python }}
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: ${{ matrix.python }}
56+
architecture: ${{ matrix.os.platform }}
57+
58+
- name: Install dependencies
59+
run: |
60+
pip install --upgrade -r requirements.txt
61+
pip install numpy # for tests
62+
63+
- name: Build and Install
64+
run: |
65+
pip install -v .
66+
67+
- name: Set Python DLL path and PYTHONHOME (non Windows)
68+
if: ${{ matrix.os.category != 'windows' }}
69+
run: |
70+
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
71+
echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV
72+
73+
- name: Set Python DLL path and PYTHONHOME (Windows)
74+
if: ${{ matrix.os.category == 'windows' }}
75+
run: |
76+
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"
77+
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')"
78+
79+
- name: Embedding tests
80+
run: dotnet test --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/embed_tests/
81+
env:
82+
MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466
83+
84+
- name: Python Tests (Mono)
85+
if: ${{ matrix.os.category != 'windows' }}
86+
run: pytest --runtime mono
87+
88+
# TODO: Run these tests on Windows x86
89+
- name: Python Tests (.NET Core)
90+
if: ${{ matrix.os.platform == 'x64' }}
91+
run: pytest --runtime coreclr
92+
93+
- name: Python Tests (.NET Framework)
94+
if: ${{ matrix.os.category == 'windows' }}
95+
run: pytest --runtime netfx
96+
97+
- name: Python tests run from .NET
98+
run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/
99+
100+
# - name: Perf tests
101+
# if: ${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }}
102+
# run: |
103+
# pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
104+
# dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/
105+
106+
# TODO: Run mono tests on Windows?
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: NuGet Preview Release
2+
3+
on:
4+
push:
5+
branches:
6+
- dynamo_py3
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
name: Release Preview
12+
runs-on: ubuntu-latest
13+
environment: NuGet
14+
timeout-minutes: 10
15+
16+
env:
17+
PYTHONNET_SHUTDOWN_MODE: Normal
18+
19+
steps:
20+
- name: Get Date
21+
run: |
22+
echo "DATE_VER=$(date "+%Y-%m-%d")" >> $GITHUB_ENV
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Setup .NET
28+
uses: actions/setup-dotnet@v1
29+
with:
30+
dotnet-version: '6.0.x'
31+
32+
- name: Set up Python 3.8
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: 3.8
36+
architecture: x64
37+
38+
- name: Install dependencies
39+
run: |
40+
pip install --upgrade -r requirements.txt
41+
pip install numpy # for tests
42+
43+
- name: Build and Install
44+
run: |
45+
pip install -v .
46+
47+
- name: Set Python DLL path (non Windows)
48+
if: ${{ matrix.os != 'windows' }}
49+
run: |
50+
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
51+
52+
- name: Python Tests
53+
run: pytest
54+
55+
- name: Embedding tests
56+
run: dotnet test --runtime any-ubuntu src/embed_tests/
57+
58+
- name: Pack
59+
run: dotnet pack --configuration Release --version-suffix preview${{env.DATE_VER}} --output "Release-Preview"
60+
61+
- name: Publish NuGet
62+
run: |
63+
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_MONTHLY }} Release-Preview/*.nupkg
64+
dotnet nuget push --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_MONTHLY }} Release-Preview/*.snupkg

nuget.config

Lines changed: 0 additions & 17 deletions
This file was deleted.

pipeline.yml

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
version: 3.1.0
22
pipeline_os: linux
33
main_branch: dynamo_py3
4-
update_changelog_on_release: true
5-
create_github_release: true
6-
create_pr_release_to_master: true
7-
8-
env:
9-
- GITHUB_ACCESS_TOKEN_ID: github_access_token_acsbuildguy
10-
# - SLACK_QUANTUM_BUILD_CHANNEL: dynamo-vera-notify
11-
12-
jenkins_creds:
13-
-
14-
type: secretText
15-
credentialsId: svc_d_dyntest-apikey-artifactory-dynamo-team-nuget
16-
secretText: API_KEY
17-
18-
# code_analysis:
19-
# sonarqube:
20-
# source_encoding: UTF-8
21-
# src: .
22-
# coverage_reports:
23-
# - coverage.info
244

255
build:
266
-
@@ -30,30 +10,6 @@ build:
3010
scripts:
3111
- scripts/install.sh
3212

33-
ci_test:
34-
tests:
35-
-
36-
customized_builder_image:
37-
registry: artifactory
38-
url: artifactory.dev.adskengineer.net/dynamo/pythonnet-build:2.0.1
39-
scripts:
40-
- scripts/install.sh
41-
- scripts/test.sh
42-
43-
publish_html_reports:
44-
-
45-
report_name: Embed Tests
46-
report_index_file: src/embed_tests/TestResults/embed_tests-output.html
47-
report_dir: .
48-
-
49-
report_name: Module Tests
50-
report_index_file: src/module_tests/TestResults/module_tests-output.html
51-
report_dir: .
52-
-
53-
report_name: Python Tests Runner
54-
report_index_file: src/python_tests_runner/TestResults/python_tests_runner-output.html
55-
report_dir: .
56-
5713
soc2:
5814
harmony:
5915
allow_branches:
@@ -63,25 +19,3 @@ soc2:
6319
third_party_lib_paths:
6420
- build\lib\pythonnet\runtime
6521
analyze_results : true
66-
67-
deployment:
68-
# CILibrary doesn't yet support signing on Linux. I tried to get this going, but haven't figured it out yet. See the vera/nuget-deploy branch on the CILibrary repo.
69-
# -
70-
# type: sign
71-
# files_to_sign:
72-
# - pythonnet/runtime/Python.Runtime.dll
73-
-
74-
type: customized
75-
allow_branches: dynamo_py3
76-
customized_builder_image:
77-
registry: artifactory
78-
url: artifactory.dev.adskengineer.net/dynamo/pythonnet-build:2.0.1
79-
scripts:
80-
- dotnet pack --configuration Release --version-suffix preview-ADSK-$(date +%s) --output "Release-Preview"
81-
- dotnet nuget push --source "Dynamo Artifactory" --api-key ${API_KEY} Release-Preview/*.nupkg
82-
- dotnet nuget push --skip-duplicate --source "Dynamo Artifactory" --api-key ${API_KEY} Release-Preview/*.snupkg
83-
84-
-
85-
type: github
86-
outputs:
87-
- build\lib\pythonnet\runtime\Python.Runtime.dll

scripts/test.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)