|
1 | | -name: Build Release artifacts |
2 | | - |
3 | | -on: |
4 | | - workflow_call: |
5 | | - workflow_dispatch: |
6 | | - |
7 | | -jobs: |
8 | | - build_release_artifacts: |
9 | | - name: Download and Build artifacts |
10 | | - runs-on: self-hosted |
11 | | - steps: |
12 | | - - uses: actions/checkout@v4 |
13 | | - |
14 | | - - uses: actions/setup-python@v4 |
15 | | - with: |
16 | | - python-version: "3.10" |
17 | | - |
18 | | - - uses: actions/download-artifact@v4 |
19 | | - id: download_artifacts |
20 | | - with: |
21 | | - path: ${{ runner.temp }}\grpc-labview-artifacts |
22 | | - |
23 | | - - name: Stage Artifacts |
24 | | - run: python ${{runner.workspace}}\grpc-labview\build-it\stage_artifacts.py --downloaded_path ${{ steps.download_artifacts.outputs.download-path }} --staging_path ${{ runner.temp }}\grpc-labview-staged-artifacts |
25 | | - |
26 | | - - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} |
27 | | - name: Build VI Packages for Testing |
28 | | - run: python ${{runner.workspace}}\grpc-labview\build-it\build.py --target All --pathToBinaries ${{ runner.temp }}\grpc-labview-staged-artifacts\TopLevelDlls |
29 | | - |
30 | | - - if: startsWith(github.ref, 'refs/tags/v') |
31 | | - name: Build VI Packages for release |
32 | | - run: python ${{runner.workspace}}\grpc-labview\build-it\build.py --libraryVersion ${{github.ref_name}} --target All --pathToBinaries ${{ runner.temp }}\grpc-labview-staged-artifacts\TopLevelDlls |
33 | | - |
34 | | - - if: startsWith(github.ref, 'refs/tags/v') |
35 | | - name: Zip Release Artifacts |
36 | | - run: | |
37 | | - cd "${{runner.workspace}}/grpc-labview/labview source/Builds" |
38 | | - tar -cavf grpc-labview.zip *.vip |
39 | | -
|
40 | | - - name: Run CI Tests |
41 | | - run: python ${{runner.workspace}}\grpc-labview\tests\run_tests.py |
42 | | - |
43 | | - - name: Get current time |
44 | | - uses: josStorer/get-current-time@v2.1.2 |
45 | | - id: current-time |
46 | | - with: |
47 | | - format: YYYY-MM-DD_hh-mm-ss |
48 | | - utcOffset: "+05:30" |
49 | | - |
50 | | - - name: Run New Testing Suite's Tests |
51 | | - timeout-minutes: 60 |
52 | | - run: python ${{runner.workspace}}\grpc-labview\tests\New_ATS\pylib\run_tests.py |
53 | | - |
54 | | - - name: Check whether logs folder exists in New_ATS |
55 | | - id: check_files |
56 | | - uses: andstor/file-existence-action@v3.0.0 |
57 | | - with: |
58 | | - files: "${{runner.workspace}}/grpc-labview/tests/New_ATS/logs/" |
59 | | - |
60 | | - - if: ${{always() && steps.check_files.outputs.files_exists == 'true' }} |
61 | | - name: Download New_ATS Test Results if logs folder exists |
62 | | - uses: actions/upload-artifact@v4 |
63 | | - with: |
64 | | - name: New_ATS Test Results ${{ steps.current-time.outputs.formattedTime }} |
65 | | - path: ${{runner.workspace}}/grpc-labview/tests/New_ATS/logs |
66 | | - |
67 | | - - if: ${{always() && steps.check_files.outputs.files_exists == 'true' }} |
68 | | - name: Show New_ATS Test Results |
69 | | - run: | |
70 | | - $directory = "${{runner.workspace}}/grpc-labview/tests/New_ATS/logs" |
71 | | -
|
72 | | - # Recursively iterate through all files in subfolders |
73 | | - Get-ChildItem -Path $directory -File -Recurse | Group-Object Directory | ForEach-Object { |
74 | | - $subfolderName = $_.Name |
75 | | -
|
76 | | - Write-Host "Folder: $subfolderName" |
77 | | -
|
78 | | - $_.Group | ForEach-Object { |
79 | | - $file = $_ |
80 | | - Write-Host "Filename: $($file.Name)" |
81 | | - Write-Host "Contents:" |
82 | | -
|
83 | | - # Print the content of the file |
84 | | - Get-Content $file.FullName |
85 | | -
|
86 | | - Write-Host "" |
87 | | - } |
88 | | - Write-Host "" |
89 | | - } |
90 | | -
|
91 | | - - if: startsWith(github.ref, 'refs/tags/v') |
92 | | - name: Create Draft Release |
93 | | - id: create_release |
94 | | - uses: actions/create-release@v1 |
95 | | - env: |
96 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
97 | | - with: |
98 | | - tag_name: ${{ github.ref }} |
99 | | - name: Verison ${{ github.ref }} |
100 | | - draft: true |
101 | | - |
102 | | - - if: startsWith(github.ref, 'refs/tags/v') |
103 | | - name: Upload Release Artifacts to Draft Release |
104 | | - uses: actions/upload-release-asset@v1 |
105 | | - env: |
106 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
107 | | - with: |
108 | | - upload_url: ${{ steps.create_release.outputs.upload_url }} |
109 | | - asset_path: ${{runner.workspace}}/grpc-labview/labview source/Builds/grpc-labview.zip |
110 | | - asset_name: grpc-labview.zip |
111 | | - asset_content_type: application/zip |
| 1 | +name: Build Release artifacts |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + build_release_artifacts: |
| 9 | + name: Download and Build artifacts |
| 10 | + runs-on: self-hosted |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - uses: actions/setup-python@v4 |
| 15 | + with: |
| 16 | + python-version: "3.10" |
| 17 | + |
| 18 | + - uses: actions/download-artifact@v4 |
| 19 | + id: download_artifacts |
| 20 | + with: |
| 21 | + path: ${{ runner.temp }}\grpc-labview-artifacts |
| 22 | + |
| 23 | + - name: Stage Artifacts |
| 24 | + run: python ${{runner.workspace}}\grpc-labview\build-it\stage_artifacts.py --downloaded_path ${{ steps.download_artifacts.outputs.download-path }} --staging_path ${{ runner.temp }}\grpc-labview-staged-artifacts |
| 25 | + |
| 26 | + - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} |
| 27 | + name: Build VI Packages for Testing |
| 28 | + run: python ${{runner.workspace}}\grpc-labview\build-it\build.py --target All --pathToBinaries ${{ runner.temp }}\grpc-labview-staged-artifacts\TopLevelDlls |
| 29 | + |
| 30 | + - if: startsWith(github.ref, 'refs/tags/v') |
| 31 | + name: Build VI Packages for release |
| 32 | + run: python ${{runner.workspace}}\grpc-labview\build-it\build.py --libraryVersion ${{github.ref_name}} --target All --pathToBinaries ${{ runner.temp }}\grpc-labview-staged-artifacts\TopLevelDlls |
| 33 | + |
| 34 | + - if: startsWith(github.ref, 'refs/tags/v') |
| 35 | + name: Zip Release Artifacts |
| 36 | + run: | |
| 37 | + cd "${{runner.workspace}}/grpc-labview/labview source/Builds" |
| 38 | + tar -cavf grpc-labview.zip *.vip |
| 39 | +
|
| 40 | + - name: Run CI Tests |
| 41 | + run: python ${{runner.workspace}}\grpc-labview\tests\run_tests.py |
| 42 | + |
| 43 | + - name: Get current time |
| 44 | + uses: josStorer/get-current-time@v2.1.2 |
| 45 | + id: current-time |
| 46 | + with: |
| 47 | + format: YYYY-MM-DD_hh-mm-ss |
| 48 | + utcOffset: "+05:30" |
| 49 | + |
| 50 | + - name: Run New Testing Suite's Tests |
| 51 | + timeout-minutes: 60 |
| 52 | + run: python ${{runner.workspace}}\grpc-labview\tests\New_ATS\pylib\run_tests.py |
| 53 | + |
| 54 | + - name: Check whether logs folder exists in New_ATS |
| 55 | + id: check_files |
| 56 | + uses: andstor/file-existence-action@v3.0.0 |
| 57 | + with: |
| 58 | + files: "${{runner.workspace}}/grpc-labview/tests/New_ATS/logs/" |
| 59 | + |
| 60 | + - if: ${{always() && steps.check_files.outputs.files_exists == 'true' }} |
| 61 | + name: Download New_ATS Test Results if logs folder exists |
| 62 | + uses: actions/upload-artifact@v4 |
| 63 | + with: |
| 64 | + name: New_ATS Test Results ${{ steps.current-time.outputs.formattedTime }} |
| 65 | + path: ${{runner.workspace}}/grpc-labview/tests/New_ATS/logs |
| 66 | + |
| 67 | + - if: ${{always() && steps.check_files.outputs.files_exists == 'true' }} |
| 68 | + name: Show New_ATS Test Results |
| 69 | + run: | |
| 70 | + $directory = "${{runner.workspace}}/grpc-labview/tests/New_ATS/logs" |
| 71 | +
|
| 72 | + # Recursively iterate through all files in subfolders |
| 73 | + Get-ChildItem -Path $directory -File -Recurse | Group-Object Directory | ForEach-Object { |
| 74 | + $subfolderName = $_.Name |
| 75 | +
|
| 76 | + Write-Host "Folder: $subfolderName" |
| 77 | +
|
| 78 | + $_.Group | ForEach-Object { |
| 79 | + $file = $_ |
| 80 | + Write-Host "Filename: $($file.Name)" |
| 81 | + Write-Host "Contents:" |
| 82 | +
|
| 83 | + # Print the content of the file |
| 84 | + Get-Content $file.FullName |
| 85 | +
|
| 86 | + Write-Host "" |
| 87 | + } |
| 88 | + Write-Host "" |
| 89 | + } |
| 90 | +
|
| 91 | + - if: startsWith(github.ref, 'refs/tags/v') |
| 92 | + name: Create Draft Release |
| 93 | + id: create_release |
| 94 | + uses: actions/create-release@v1 |
| 95 | + env: |
| 96 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 97 | + with: |
| 98 | + tag_name: ${{ github.ref }} |
| 99 | + name: Verison ${{ github.ref }} |
| 100 | + draft: true |
| 101 | + |
| 102 | + - if: startsWith(github.ref, 'refs/tags/v') |
| 103 | + name: Upload Release Artifacts to Draft Release |
| 104 | + uses: actions/upload-release-asset@v1 |
| 105 | + env: |
| 106 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 107 | + with: |
| 108 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 109 | + asset_path: ${{runner.workspace}}/grpc-labview/labview source/Builds/grpc-labview.zip |
| 110 | + asset_name: grpc-labview.zip |
| 111 | + asset_content_type: application/zip |
0 commit comments