From 879987f467658260ae4f3fadcea799825b93752e Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Mon, 13 Jan 2025 15:46:46 -0800 Subject: [PATCH] try debug test --- .github/workflows/main.yml | 216 +++++++++---------------------------- 1 file changed, 53 insertions(+), 163 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b15fdf61..5729f3ba5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,206 +26,90 @@ env: PACKAGE_NAME: osn jobs: - # macos64: - # name: 'macOS' - # runs-on: ${{ matrix.image }} - # strategy: - # matrix: - # BuildReleases: [Release-x86_64, Release-arm64] - # include: - # - BuildReleases: Release-x86_64 - # image: macos-13 - # BuildConfig: RelWithDebInfo - # ReleaseName: release - # Architecture: x86_64 - # - BuildReleases: Release-arm64 - # image: macos-14 - # BuildConfig: RelWithDebInfo - # ReleaseName: release - # Architecture: arm64 - # env: - # OS_TAG: "osx" - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v3 - # with: - # submodules: 'recursive' - # - name: Get the version - # id: get_version - # run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - # shell: bash - # - name: Install Node.js - # uses: actions/setup-node@v3 - # with: - # node-version: '18.x' - # - name: Install dependencies - # shell: bash - # run: './ci/install-dependencies-osx.sh' - # - name: 'Configure obs-studio-node' - # shell: bash - # run: './ci/configure-osn-osx.sh' - # env: - # BUILD_CONFIG: ${{matrix.BuildConfig}} - # RELEASE_NAME: ${{matrix.ReleaseName}} - # ARCHITECTURE: ${{matrix.Architecture}} - # tagartifact: ${{ steps.get_version.outputs.VERSION }} - # - name: 'Build obs-studio-node' - # run: ./ci/build-osn-osx.sh - # shell: bash - # env: - # BUILD_CONFIG: ${{matrix.BuildConfig}} - # SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} - # - name: Put version into package.json - # if: startsWith(github.ref, 'refs/tags/') - # run: node ci/bump-version.js "${{ steps.get_version.outputs.VERSION }}" "${{env.PACKAGE_PATH}}" - # env: - # PACKAGE_PATH: "${{env.SLFullDistributePath}}/${{env.InstallPath}}" - # - name: 'Run tests' - # continue-on-error: true - # run: 'yarn run test' - # env: - # SLOBS_BE_STREAMKEY: ${{secrets.testsStreamKey}} - # SLOBS_TEST_USER_POOL_TOKEN: ${{secrets.testsUserPoolToken}} - - # OSN_ACCESS_KEY_ID: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}} - # OSN_SECRET_ACCESS_KEY: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}} - # RELEASE_NAME: ${{matrix.ReleaseName}} - - # - name: Tar artifact for deployment - # if: startsWith(github.ref, 'refs/tags/') - # run: tar -cvzf ${{env.TARGET_ARTIFACT}}.tar.gz -C ${{env.SLFullDistributePath}} ${{env.InstallPath}} - # env: - # TARGET_ARTIFACT: ${{env.PACKAGE_NAME}}-${{ steps.get_version.outputs.VERSION }}-${{matrix.ReleaseName}}-${{env.OS_TAG}}-${{matrix.Architecture}} - # - name: Configure AWS credentials - # if: startsWith(github.ref, 'refs/tags/') - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}} - # aws-secret-access-key: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}} - # aws-region: us-west-2 - # - name: Deploy - # if: startsWith(github.ref, 'refs/tags/') - # run: aws s3 cp ${{env.TARGET_ARTIFACT}}.tar.gz s3://${{env.RELEASE_BUCKET}} --acl public-read - # env: - # TARGET_ARTIFACT: ${{env.PACKAGE_NAME}}-${{ steps.get_version.outputs.VERSION }}-${{matrix.ReleaseName}}-${{env.OS_TAG}}-${{matrix.Architecture}} - # - name: 'Upload debug files to Sentry' - # if: startsWith(github.ref, 'refs/tags/') - # run: 'python ./ci/sentry-osx.py' - # env: - # SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} - # BUILDCONFIG: ${{matrix.BuildConfig}} - - win64: - name: 'Windows 64-bit' - runs-on: windows-latest + windows_self_hosted: + name: 'Windows 64-bit (build and test in one job)' + runs-on: self-hosted strategy: matrix: ReleaseName: [release] include: - - ReleaseName: release - ReleaseConfig: RelWithDebInfo + - ReleaseName: release + ReleaseConfig: RelWithDebInfo env: OS_TAG: "win64" steps: - name: 'Add msbuild to PATH' uses: microsoft/setup-msbuild@v1 + - name: Install older build components run: | - # For versions update see here: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022 + # For version updates see: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022 Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" $componentsToInstall= @( - "Microsoft.VisualStudio.Component.VC.v141.x86.x64" - "Microsoft.VisualStudio.Component.VC.14.39.17.9.x86.x64" - "Microsoft.VisualStudio.Component.VC.14.39.17.9.ATL" + "Microsoft.VisualStudio.Component.VC.v141.x86.x64" + "Microsoft.VisualStudio.Component.VC.14.39.17.9.x86.x64" + "Microsoft.VisualStudio.Component.VC.14.39.17.9.ATL" ) - [string]$workloadArgs = $componentsToInstall | ForEach-Object {" --add " + $_} - $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') - # should be run twice + [string]$workloadArgs = $componentsToInstall | ForEach-Object {" --add " + $_} + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $workloadArgs, '--quiet', '--norestart', '--nocache') + # Run twice because the VS installer can be finicky about multi-component installs. $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden shell: powershell - - name: 'Checkout' + + - name: 'Checkout code' uses: actions/checkout@v3 with: submodules: 'recursive' + - name: Get the version id: get_version run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT shell: bash + - name: Install dependencies run: | yarn install --immutable --immutable-cache --check-cache - yarn add electron@${{env.ElectronVersion}} -D + yarn add electron@${{ env.ElectronVersion }} -D + - name: Configure obs-studio-node run: ./ci/configure-osn.cmd env: - ReleaseName: ${{matrix.ReleaseName}} + ReleaseName: ${{ matrix.ReleaseName }} tagartifact: ${{ steps.get_version.outputs.VERSION }} + - name: Build obs-studio-node - run: cmake --build ${{env.SLBUILDDIRECTORY}} --target install --config ${{matrix.ReleaseConfig}} + run: cmake --build ${{ env.SLBUILDDIRECTORY }} --target install --config ${{ matrix.ReleaseConfig }} + - name: Put version into package.json if: startsWith(github.ref, 'refs/tags/') - run: node ci/bump-version.js "${{ steps.get_version.outputs.VERSION }}" "${{env.PACKAGE_PATH}}" + run: node ci/bump-version.js "${{ steps.get_version.outputs.VERSION }}" "${{ env.PACKAGE_PATH }}" env: - PACKAGE_PATH: "${{env.SLFullDistributePath}}/${{env.InstallPath}}" - - name: Cache build - uses: actions/cache@v3 - with: - path: | - ${{env.SLBUILDDIRECTORY}} - tests/ - key: ${{ runner.os }}-build-${{ matrix.ReleaseName }}-${{ github.sha }} - - win64_tests: - name: 'Windows 64-bit tests' - runs-on: self-hosted - needs: [win64] - strategy: - matrix: - ReleaseName: [release] - include: - - ReleaseName: release - ReleaseConfig: RelWithDebInfo - env: - OS_TAG: "win64" - steps: - - name: 'Add msbuild to PATH' - uses: microsoft/setup-msbuild@v1 - - name: 'Checkout' - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - name: Get the version - id: get_version - run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - shell: bash - - name: Install dependencies - run: | - yarn install --immutable --immutable-cache --check-cache - yarn add electron@${{env.ElectronVersion}} -D + PACKAGE_PATH: "${{ env.SLFullDistributePath }}/${{ env.InstallPath }}" - - name: Get build from cache + - name: Cache build uses: actions/cache@v3 with: path: | - ${{env.SLBUILDDIRECTORY}} + ${{ env.SLBUILDDIRECTORY }} tests/ key: ${{ runner.os }}-build-${{ matrix.ReleaseName }}-${{ github.sha }} - - name: 'Run tests' - continue-on-error: false - run: 'yarn run test' + - name: Run tests + # Adjust continue-on-error if you want to allow failures + run: yarn run test env: - SLOBS_BE_STREAMKEY: ${{secrets.testsStreamKey}} - SLOBS_TEST_USER_POOL_TOKEN: ${{secrets.testsUserPoolToken}} + SLOBS_BE_STREAMKEY: ${{ secrets.testsStreamKey }} + SLOBS_TEST_USER_POOL_TOKEN: ${{ secrets.testsUserPoolToken }} + OSN_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + OSN_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} + RELEASE_NAME: ${{ matrix.ReleaseName }} - OSN_ACCESS_KEY_ID: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}} - OSN_SECRET_ACCESS_KEY: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}} - RELEASE_NAME: ${{matrix.ReleaseName}} - name: Get the version of aws cli run: aws --version shell: powershell + - name: Install specific version of AWS CLI run: | $version = "2.15.17" @@ -234,9 +118,11 @@ jobs: Start-Process msiexec.exe -Wait -ArgumentList "/i $zipfile /qn" rm $zipfile shell: pwsh + - name: Get the version of aws cli after install run: aws --version shell: powershell + - name: Fetch symsrv-scripts if: startsWith(github.ref, 'refs/tags/') uses: actions/checkout@v3 @@ -244,34 +130,38 @@ jobs: fetch-depth: 2 repository: stream-labs/symsrv-scripts path: symsrv-scripts + - name: Run symbol server scripts if: startsWith(github.ref, 'refs/tags/') - run: ./symsrv-scripts/main.bat "${{ github.workspace }}/symsrv-scripts" ".\main.ps1 -pdbPaths '${{ github.workspace }}\${{env.SLBUILDDIRECTORY}}\lib-streamlabs-ipc,${{ github.workspace }}\${{env.SLBUILDDIRECTORY}}\obs-studio-client,${{ github.workspace }}\${{env.SLBUILDDIRECTORY}}\obs-studio-server' -localSourceDir '${{ github.workspace }}' -repo_userId 'stream-labs' -repo_name 'obs-studio-node' -repo_branch '${{ github.sha }}' -subModules 'lib-streamlabs-ipc,stream-labs,lib-streamlabs-ipc,streamlabs'" + run: ./symsrv-scripts/main.bat "${{ github.workspace }}/symsrv-scripts" ".\main.ps1 -pdbPaths '${{ github.workspace }}\${{ env.SLBUILDDIRECTORY }}\lib-streamlabs-ipc,${{ github.workspace }}\${{ env.SLBUILDDIRECTORY }}\obs-studio-client,${{ github.workspace }}\${{ env.SLBUILDDIRECTORY }}\obs-studio-server' -localSourceDir '${{ github.workspace }}' -repo_userId 'stream-labs' -repo_name 'obs-studio-node' -repo_branch '${{ github.sha }}' -subModules 'lib-streamlabs-ipc,stream-labs,lib-streamlabs-ipc,streamlabs'" env: - AWS_SYMB_ACCESS_KEY_ID: ${{secrets.AWS_SYMB_ACCESS_KEY_ID}} - AWS_SYMB_SECRET_ACCESS_KEY: ${{secrets.AWS_SYMB_SECRET_ACCESS_KEY}} + AWS_SYMB_ACCESS_KEY_ID: ${{ secrets.AWS_SYMB_ACCESS_KEY_ID }} + AWS_SYMB_SECRET_ACCESS_KEY: ${{ secrets.AWS_SYMB_SECRET_ACCESS_KEY }} shell: powershell - - name: 'Copy necessary dll files' + - name: Copy necessary dll files run: ./ci/copy-files.cmd - - name: 'Prepare tag artifact' + + - name: Prepare tag artifact if: startsWith(github.ref, 'refs/tags/') run: ./ci/prepare-artifact.cmd - name: Tar artifact for deployment if: startsWith(github.ref, 'refs/tags/') - run: tar -cvzf ${{env.TARGET_ARTIFACT}}.tar.gz -C ${{env.SLFullDistributePath}} ${{env.InstallPath}} + run: tar -cvzf ${{ env.TARGET_ARTIFACT }}.tar.gz -C ${{ env.SLFullDistributePath }} ${{ env.InstallPath }} env: - TARGET_ARTIFACT: ${{env.PACKAGE_NAME}}-${{ steps.get_version.outputs.VERSION }}-${{matrix.ReleaseName}}-${{env.OS_TAG}} + TARGET_ARTIFACT: ${{ env.PACKAGE_NAME }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.ReleaseName }}-${{ env.OS_TAG }} + - name: Configure AWS credentials if: startsWith(github.ref, 'refs/tags/') uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}} - aws-secret-access-key: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}} + aws-access-key-id: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }} aws-region: us-west-2 + - name: Deploy if: startsWith(github.ref, 'refs/tags/') - run: aws s3 cp ${{env.TARGET_ARTIFACT}}.tar.gz s3://${{env.RELEASE_BUCKET}} --acl public-read + run: aws s3 cp ${{ env.TARGET_ARTIFACT }}.tar.gz s3://${{ env.RELEASE_BUCKET }} --acl public-read env: - TARGET_ARTIFACT: ${{env.PACKAGE_NAME}}-${{ steps.get_version.outputs.VERSION }}-${{matrix.ReleaseName}}-${{env.OS_TAG}} + TARGET_ARTIFACT: ${{ env.PACKAGE_NAME }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.ReleaseName }}-${{ env.OS_TAG }}