From d47b71b2f1ba7969a7c5b44625f91e37214878d7 Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 19:36:55 -0400 Subject: [PATCH 01/12] feat(ci): migrate CI/CD from Azure Pipelines to GitHub Actions (#18) Add monolith GitHub Actions workflow with 17 jobs covering build, test, packaging, analysis, and notifications. Disable Azure Pipelines triggers while preserving the file for reference. Jobs: setup (git tag counter), build-backend (cross-compile all RIDs), build-frontend, packages (13 archives), lint, unit/integration tests (native + docker + postgres), Windows installer, Sentry source map upload, SonarCloud analysis (frontend + backend), API docs generation, and Discord notifications. --- .github/workflows/ci.yml | 974 +++++++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 42 +- 2 files changed, 998 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..ac39f76834f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,974 @@ +name: CI + +on: + push: + branches: + - develop + - master + paths-ignore: + - '.github/**' + - 'src/Radarr.Api.*/openapi.json' + pull_request: + branches: + - develop + paths-ignore: + - '.github/**' + - 'src/NzbDrone.Core/Localization/Core/**' + - 'src/Radarr.Api.*/openapi.json' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + MAJOR_VERSION: '6.1.1' + DOTNET_VERSION: '8.0.405' + NODE_VERSION: '20.11.1' + INNO_VERSION: '6.2.2' + +jobs: + # --------------------------------------------------------------------------- + # Setup: generate build number, detect backend changes + # --------------------------------------------------------------------------- + setup: + runs-on: ubuntu-24.04 + outputs: + build_number: ${{ steps.counter.outputs.build_number }} + radarr_version: ${{ steps.counter.outputs.radarr_version }} + branch_name: ${{ steps.counter.outputs.branch_name }} + backend_changed: ${{ steps.changes.outputs.backend_changed }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate build number + id: counter + env: + MAJOR_VERSION: ${{ env.MAJOR_VERSION }} + run: | + git fetch --tags --force + LAST=$(git tag -l 'build-counter-*' | sed 's/build-counter-//' | sort -n | tail -1) + NEXT=$(( ${LAST:-2999} + 1 )) + echo "build_number=$NEXT" >> "$GITHUB_OUTPUT" + echo "radarr_version=${MAJOR_VERSION}.${NEXT}" >> "$GITHUB_OUTPUT" + + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "branch_name=${{ github.head_ref }}" >> "$GITHUB_OUTPUT" + else + echo "branch_name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + fi + + - name: Push build counter tag + if: github.event_name != 'pull_request' + env: + BUILD_NUMBER: ${{ steps.counter.outputs.build_number }} + run: | + for attempt in 1 2 3; do + if git tag "build-counter-${BUILD_NUMBER}" && git push origin "build-counter-${BUILD_NUMBER}"; then + echo "Tag pushed successfully on attempt $attempt" + break + fi + echo "Tag push failed on attempt $attempt, retrying..." + git fetch --tags --force + LAST=$(git tag -l 'build-counter-*' | sed 's/build-counter-//' | sort -n | tail -1) + BUILD_NUMBER=$(( LAST + 1 )) + echo "build_number=$BUILD_NUMBER" >> "$GITHUB_OUTPUT" + echo "radarr_version=${MAJOR_VERSION}.${BUILD_NUMBER}" >> "$GITHUB_OUTPUT" + done + + - name: Detect backend changes + id: changes + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + git diff origin/develop...HEAD --name-only | grep -qE "^(src/|azure-pipelines.yml)" \ + && echo "backend_changed=true" >> "$GITHUB_OUTPUT" \ + || echo "backend_changed=false" >> "$GITHUB_OUTPUT" + else + echo "backend_changed=true" >> "$GITHUB_OUTPUT" + fi + + # --------------------------------------------------------------------------- + # Build Backend: cross-compile all RIDs from a single Linux runner + # --------------------------------------------------------------------------- + build-backend: + runs-on: ubuntu-24.04 + needs: setup + env: + RADARRVERSION: ${{ needs.setup.outputs.radarr_version }} + BUILD_SOURCEBRANCHNAME: ${{ needs.setup.outputs.branch_name }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 1 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} + restore-keys: nuget-${{ runner.os }}- + + - name: Enable FreeBSD platform in SDK + run: | + BUNDLED="${DOTNET_ROOT}/sdk/${DOTNET_VERSION}/Microsoft.NETCoreSdk.BundledVersions.props" + echo "Patching: $BUNDLED" + if grep -q freebsd-x64 "$BUNDLED"; then + echo "Extra platforms already enabled" + else + sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64/' "$BUNDLED" + fi + + - name: Build backend + run: ./build.sh --backend --enable-extra-platforms + + - name: Clean intermediate output + run: | + find _output -type f ! -path "*/publish/*" -exec rm -rf {} \; + find _output -depth -empty -type d -exec rm -r "{}" \; + find _tests -type f ! -path "*/publish/*" -exec rm -rf {} \; + find _tests -depth -empty -type d -exec rm -r "{}" \; + + - name: Upload backend output + uses: actions/upload-artifact@v4 + with: + name: backend-output + path: _output/ + compression-level: 1 + + - name: Upload win-x64 tests + uses: actions/upload-artifact@v4 + with: + name: win-x64-tests + path: _tests/net8.0/win-x64/publish/ + + - name: Upload linux-x64 tests + uses: actions/upload-artifact@v4 + with: + name: linux-x64-tests + path: _tests/net8.0/linux-x64/publish/ + + - name: Upload linux-musl-x64 tests + uses: actions/upload-artifact@v4 + with: + name: linux-musl-x64-tests + path: _tests/net8.0/linux-musl-x64/publish/ + + - name: Upload osx-x64 tests + uses: actions/upload-artifact@v4 + with: + name: osx-x64-tests + path: _tests/net8.0/osx-x64/publish/ + + # --------------------------------------------------------------------------- + # Build Frontend + # --------------------------------------------------------------------------- + build-frontend: + runs-on: ubuntu-24.04 + needs: setup + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 1 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Cache Yarn packages + uses: actions/cache@v4 + with: + path: ~/.cache/yarn + key: yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }} + restore-keys: yarn-${{ runner.os }}- + + - name: Build frontend + run: ./build.sh --frontend + env: + FORCE_COLOR: '0' + YARN_CACHE_FOLDER: ~/.cache/yarn + + - name: Upload frontend output + uses: actions/upload-artifact@v4 + with: + name: frontend-output + path: _output/UI/ + + # --------------------------------------------------------------------------- + # Packages: create archives for all platforms + # --------------------------------------------------------------------------- + packages: + runs-on: ubuntu-24.04 + needs: [build-backend, build-frontend, setup] + env: + RADARRVERSION: ${{ needs.setup.outputs.radarr_version }} + BUILD_SOURCEBRANCHNAME: ${{ needs.setup.outputs.branch_name }} + BUILDNAME: ${{ needs.setup.outputs.branch_name }}.${{ needs.setup.outputs.radarr_version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Download backend output + uses: actions/download-artifact@v4 + with: + name: backend-output + path: _output/ + + - name: Download frontend output + uses: actions/download-artifact@v4 + with: + name: frontend-output + path: _output/UI/ + + - name: Create packages + run: ./build.sh --packages --enable-extra-platforms + + - name: Set executable bits + run: | + find . -name "ffprobe" -exec chmod a+x {} \; + find . -name "Radarr" -exec chmod a+x {} \; + find . -name "Radarr.Update" -exec chmod a+x {} \; + + - name: Create archives + run: | + mkdir -p _archives + + # Windows zips + cd _artifacts/win-x64/net8.0 && zip -r ../../../_archives/Radarr.${BUILDNAME}.windows-core-x64.zip . && cd ../../.. + cd _artifacts/win-x86/net8.0 && zip -r ../../../_archives/Radarr.${BUILDNAME}.windows-core-x86.zip . && cd ../../.. + + # macOS app zips + cd _artifacts/osx-x64-app/net8.0 && zip -r ../../../_archives/Radarr.${BUILDNAME}.osx-app-core-x64.zip . && cd ../../.. + cd _artifacts/osx-arm64-app/net8.0 && zip -r ../../../_archives/Radarr.${BUILDNAME}.osx-app-core-arm64.zip . && cd ../../.. + + # macOS tars + tar -czf _archives/Radarr.${BUILDNAME}.osx-core-x64.tar.gz -C _artifacts/osx-x64/net8.0 . + tar -czf _archives/Radarr.${BUILDNAME}.osx-core-arm64.tar.gz -C _artifacts/osx-arm64/net8.0 . + + # Linux tars + tar -czf _archives/Radarr.${BUILDNAME}.linux-core-x64.tar.gz -C _artifacts/linux-x64/net8.0 . + tar -czf _archives/Radarr.${BUILDNAME}.linux-musl-core-x64.tar.gz -C _artifacts/linux-musl-x64/net8.0 . + tar -czf _archives/Radarr.${BUILDNAME}.linux-core-arm.tar.gz -C _artifacts/linux-arm/net8.0 . + tar -czf _archives/Radarr.${BUILDNAME}.linux-musl-core-arm.tar.gz -C _artifacts/linux-musl-arm/net8.0 . + tar -czf _archives/Radarr.${BUILDNAME}.linux-core-arm64.tar.gz -C _artifacts/linux-arm64/net8.0 . + tar -czf _archives/Radarr.${BUILDNAME}.linux-musl-core-arm64.tar.gz -C _artifacts/linux-musl-arm64/net8.0 . + + # FreeBSD tar + tar -czf _archives/Radarr.${BUILDNAME}.freebsd-core-x64.tar.gz -C _artifacts/freebsd-x64/net8.0 . + + - name: Upload packages + uses: actions/upload-artifact@v4 + with: + name: packages + path: _archives/ + + # --------------------------------------------------------------------------- + # Lint + # --------------------------------------------------------------------------- + lint: + runs-on: ubuntu-24.04 + needs: setup + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 1 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Cache Yarn packages + uses: actions/cache@v4 + with: + path: ~/.cache/yarn + key: yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }} + restore-keys: yarn-${{ runner.os }}- + + - name: Lint + run: ./build.sh --lint + env: + FORCE_COLOR: '0' + YARN_CACHE_FOLDER: ~/.cache/yarn + + # --------------------------------------------------------------------------- + # Unit Tests: native platforms + # --------------------------------------------------------------------------- + unit-test-native: + needs: [build-backend, setup] + if: needs.setup.outputs.backend_changed == 'true' + strategy: + fail-fast: false + matrix: + include: + - os: macos-15 + platform: Mac + artifact: osx-x64-tests + test-name: osx-x64 + - os: windows-2025 + platform: Windows + artifact: win-x64-tests + test-name: win-x64 + - os: ubuntu-24.04 + platform: Linux + artifact: linux-x64-tests + test-name: linux-x64 + runs-on: ${{ matrix.os }} + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download test artifact + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: _tests/ + + - name: Enable Windows test service + if: matrix.platform == 'Windows' + run: Set-Service SCardSvr -StartupType Manual + shell: pwsh + + - name: Set executable permissions + if: matrix.platform != 'Windows' + run: | + chmod a+x _tests/ffprobe + find _tests -name "Radarr.Test.Dummy" -exec chmod a+x {} \; + + - name: Run unit tests + run: | + chmod a+x _tests/test.sh + _tests/test.sh ${{ matrix.platform }} Unit Test + env: + TEST_DIR: ${{ github.workspace }}/_tests + shell: bash + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{ matrix.test-name }}-unit-test-results + path: '**/TestResult.xml' + + - name: Report test results + uses: dorny/test-reporter@v1 + if: always() + with: + name: ${{ matrix.test-name }} Unit Tests + path: '**/TestResult.xml' + reporter: java-junit + fail-on-error: true + + # --------------------------------------------------------------------------- + # Unit Tests: Docker (Alpine / musl) + # --------------------------------------------------------------------------- + unit-test-docker: + runs-on: ubuntu-24.04 + needs: [build-backend, setup] + if: needs.setup.outputs.backend_changed == 'true' + container: + image: ghcr.io/servarr/testimages:alpine + timeout-minutes: 10 + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download test artifact + uses: actions/download-artifact@v4 + with: + name: linux-musl-x64-tests + path: _tests/ + + - name: Set executable permissions + run: | + chmod a+x _tests/ffprobe + find _tests -name "Radarr.Test.Dummy" -exec chmod a+x {} \; + + - name: Run unit tests + run: | + chmod a+x _tests/test.sh + _tests/test.sh Linux Unit Test + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: musl-unit-test-results + path: '**/TestResult.xml' + + # --------------------------------------------------------------------------- + # Unit Tests: Postgres + # --------------------------------------------------------------------------- + unit-test-postgres: + runs-on: ubuntu-24.04 + needs: [build-backend, setup] + if: needs.setup.outputs.backend_changed == 'true' + strategy: + fail-fast: false + matrix: + postgres-version: ['14', '15'] + services: + postgres: + image: postgres:${{ matrix.postgres-version }} + env: + POSTGRES_USER: radarr + POSTGRES_PASSWORD: radarr + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + timeout-minutes: 10 + env: + Radarr__Postgres__Host: localhost + Radarr__Postgres__Port: '5432' + Radarr__Postgres__User: radarr + Radarr__Postgres__Password: radarr + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download test artifact + uses: actions/download-artifact@v4 + with: + name: linux-x64-tests + path: _tests/ + + - name: Set executable permissions + run: | + chmod a+x _tests/ffprobe + find _tests -name "Radarr.Test.Dummy" -exec chmod a+x {} \; + + - name: Run unit tests + run: | + chmod a+x _tests/test.sh + _tests/test.sh Linux Unit Test + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: postgres${{ matrix.postgres-version }}-unit-test-results + path: '**/TestResult.xml' + + # --------------------------------------------------------------------------- + # Integration Tests: native platforms + # --------------------------------------------------------------------------- + integration-native: + needs: [packages, build-backend, setup] + if: needs.setup.outputs.backend_changed == 'true' + strategy: + fail-fast: false + matrix: + include: + - os: macos-15 + platform: Mac + artifact: osx-x64-tests + test-name: osx-x64 + pattern: 'Radarr.*.osx-core-x64.tar.gz' + extract-cmd: 'tar xzf' + - os: windows-2025 + platform: Windows + artifact: win-x64-tests + test-name: win-x64 + pattern: 'Radarr.*.windows-core-x64.zip' + extract-cmd: 'unzip' + - os: ubuntu-24.04 + platform: Linux + artifact: linux-x64-tests + test-name: linux-x64 + pattern: 'Radarr.*.linux-core-x64.tar.gz' + extract-cmd: 'tar xzf' + runs-on: ${{ matrix.os }} + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download test artifact + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: _tests/ + + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: packages + path: _packages/ + + - name: Extract package + run: | + mkdir -p _extracted + ARCHIVE=$(find _packages -name "${{ matrix.pattern }}" | head -1) + echo "Extracting: $ARCHIVE" + if [[ "$ARCHIVE" == *.zip ]]; then + unzip "$ARCHIVE" -d _extracted/ + else + tar xzf "$ARCHIVE" -C _extracted/ + fi + mkdir -p ./bin/ + cp -r _extracted/Radarr/. ./bin/ 2>/dev/null || cp -r _extracted/. ./bin/ + shell: bash + + - name: Enable Windows test service + if: matrix.platform == 'Windows' + run: Set-Service SCardSvr -StartupType Manual + shell: pwsh + + - name: Set executable permissions + if: matrix.platform != 'Windows' + run: | + chmod a+x _tests/ffprobe + find _tests -name "Radarr.Test.Dummy" -exec chmod a+x {} \; + + - name: Run integration tests + run: | + chmod a+x _tests/test.sh + _tests/test.sh ${{ matrix.platform }} Integration Test + env: + TEST_DIR: ${{ github.workspace }}/_tests + shell: bash + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{ matrix.test-name }}-integration-test-results + path: '**/TestResult.xml' + + # --------------------------------------------------------------------------- + # Integration Tests: Docker (Alpine / musl) + # --------------------------------------------------------------------------- + integration-docker: + runs-on: ubuntu-24.04 + needs: [packages, build-backend, setup] + if: needs.setup.outputs.backend_changed == 'true' + container: + image: ghcr.io/servarr/testimages:alpine + timeout-minutes: 15 + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download test artifact + uses: actions/download-artifact@v4 + with: + name: linux-musl-x64-tests + path: _tests/ + + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: packages + path: _packages/ + + - name: Extract package + run: | + mkdir -p _extracted + ARCHIVE=$(find _packages -name "Radarr.*.linux-musl-core-x64.tar.gz" | head -1) + tar xzf "$ARCHIVE" -C _extracted/ + mkdir -p ./bin/ + cp -r _extracted/Radarr/. ./bin/ 2>/dev/null || cp -r _extracted/. ./bin/ + + - name: Set executable permissions + run: | + chmod a+x _tests/ffprobe + find _tests -name "Radarr.Test.Dummy" -exec chmod a+x {} \; + + - name: Run integration tests + run: | + chmod a+x _tests/test.sh + _tests/test.sh Linux Integration Test + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: musl-integration-test-results + path: '**/TestResult.xml' + + # --------------------------------------------------------------------------- + # Integration Tests: Postgres + # --------------------------------------------------------------------------- + integration-postgres: + runs-on: ubuntu-24.04 + needs: [packages, build-backend, setup] + if: needs.setup.outputs.backend_changed == 'true' + strategy: + fail-fast: false + matrix: + postgres-version: ['14', '15'] + services: + postgres: + image: postgres:${{ matrix.postgres-version }} + env: + POSTGRES_USER: radarr + POSTGRES_PASSWORD: radarr + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + timeout-minutes: 15 + env: + Radarr__Postgres__Host: localhost + Radarr__Postgres__Port: '5432' + Radarr__Postgres__User: radarr + Radarr__Postgres__Password: radarr + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download test artifact + uses: actions/download-artifact@v4 + with: + name: linux-x64-tests + path: _tests/ + + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: packages + path: _packages/ + + - name: Extract package + run: | + mkdir -p _extracted + ARCHIVE=$(find _packages -name "Radarr.*.linux-core-x64.tar.gz" | head -1) + tar xzf "$ARCHIVE" -C _extracted/ + mkdir -p ./bin/ + cp -r _extracted/Radarr/. ./bin/ 2>/dev/null || cp -r _extracted/. ./bin/ + + - name: Set executable permissions + run: | + chmod a+x _tests/ffprobe + find _tests -name "Radarr.Test.Dummy" -exec chmod a+x {} \; + + - name: Run integration tests + run: | + chmod a+x _tests/test.sh + _tests/test.sh Linux Integration Test + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: postgres${{ matrix.postgres-version }}-integration-test-results + path: '**/TestResult.xml' + + # --------------------------------------------------------------------------- + # Windows Installer + # --------------------------------------------------------------------------- + installer: + runs-on: windows-2025 + needs: [build-backend, build-frontend, setup] + env: + RADARRVERSION: ${{ needs.setup.outputs.radarr_version }} + MAJORVERSION: ${{ env.MAJOR_VERSION }} + INNOVERSION: ${{ env.INNO_VERSION }} + BUILD_SOURCEBRANCHNAME: ${{ needs.setup.outputs.branch_name }} + BUILDNAME: ${{ needs.setup.outputs.branch_name }}.${{ needs.setup.outputs.radarr_version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Download backend output + uses: actions/download-artifact@v4 + with: + name: backend-output + path: _output/ + + - name: Download frontend output + uses: actions/download-artifact@v4 + with: + name: frontend-output + path: _output/UI/ + + - name: Create installer + run: ./build.sh --packages --installer + shell: bash + + - name: Stage installer files + run: | + mkdir -p _installer_output + cp distribution/windows/setup/output/Radarr.*win-x64.exe "_installer_output/Radarr.${BUILDNAME}.windows-core-x64-installer.exe" + cp distribution/windows/setup/output/Radarr.*win-x86.exe "_installer_output/Radarr.${BUILDNAME}.windows-core-x86-installer.exe" + shell: bash + + - name: Upload installer + uses: actions/upload-artifact@v4 + with: + name: windows-installer + path: _installer_output/ + + # --------------------------------------------------------------------------- + # Sentry: upload source maps and create release + # --------------------------------------------------------------------------- + sentry: + runs-on: ubuntu-24.04 + needs: [packages, build-frontend, setup] + if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ vars.SENTRY_ORG }} + SENTRY_URL: ${{ vars.SENTRY_URL }} + steps: + - name: Download frontend output + uses: actions/download-artifact@v4 + with: + name: frontend-output + path: _output/UI/ + + - name: Install Sentry CLI + run: curl -sL https://sentry.io/get-cli/ | bash + + - name: Upload source maps + env: + RADARR_VERSION: ${{ needs.setup.outputs.radarr_version }} + BRANCH_NAME: ${{ needs.setup.outputs.branch_name }} + run: | + RELEASENAME="Radarr@${RADARR_VERSION}-${BRANCH_NAME}" + sentry-cli releases new --finalize -p radarr -p radarr-ui -p radarr-update "${RELEASENAME}" + sentry-cli releases -p radarr-ui files "${RELEASENAME}" upload-sourcemaps _output/UI/ --rewrite + sentry-cli releases set-commits --auto "${RELEASENAME}" + if [ "${GITHUB_REF}" = "refs/heads/develop" ]; then + sentry-cli releases deploys "${RELEASENAME}" new -e nightly + else + sentry-cli releases deploys "${RELEASENAME}" new -e production + fi + + # --------------------------------------------------------------------------- + # SonarCloud: Frontend analysis + # --------------------------------------------------------------------------- + sonarcloud-frontend: + runs-on: ubuntu-24.04 + needs: setup + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: SonarCloud scan + uses: SonarSource/sonarqube-scan-action@v5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.projectKey=Radarr_Radarr.UI + -Dsonar.organization=radarr + -Dsonar.sources=./frontend + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.projectVersion=${{ needs.setup.outputs.radarr_version }} + + # --------------------------------------------------------------------------- + # SonarCloud: Backend analysis with coverage + # --------------------------------------------------------------------------- + sonarcloud-backend: + runs-on: windows-2025 + needs: setup + if: needs.setup.outputs.backend_changed == 'true' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Enable Windows test service + run: Set-Service SCardSvr -StartupType Manual + shell: pwsh + + - name: Install SonarScanner + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + run: dotnet tool install --global dotnet-sonarscanner + + - name: SonarCloud begin + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + dotnet sonarscanner begin \ + /k:"Radarr_Radarr" \ + /o:"radarr" \ + /d:sonar.token="${SONAR_TOKEN}" \ + /d:sonar.host.url="https://sonarcloud.io" \ + /d:sonar.projectVersion="${{ needs.setup.outputs.radarr_version }}" \ + /d:sonar.exclusions="**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**" \ + /d:sonar.coverage.exclusions="**/Radarr.Api.V3/**/*" \ + /d:sonar.cs.cobertura.reportsPaths="$(pwd)/CoverageResults/**/coverage.cobertura.xml" \ + /d:sonar.cs.nunit.reportsPaths="$(pwd)/TestResult.xml" + shell: bash + + - name: Build and run coverage tests + run: | + ./build.sh --backend -f net8.0 -r win-x64 + TEST_DIR=_tests/net8.0/win-x64/publish/ ./test.sh Windows Unit Coverage + shell: bash + + - name: SonarCloud end + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + shell: bash + + - name: Generate coverage report + uses: danielpalme/ReportGenerator-GitHub-Action@5 + if: always() + with: + reports: CoverageResults/**/coverage.cobertura.xml + targetdir: CoverageResults/combined + reporttypes: HtmlInline;Cobertura;Badges + sourcedirs: src + + # --------------------------------------------------------------------------- + # API Docs: generate OpenAPI spec, create PR + # --------------------------------------------------------------------------- + api-docs: + runs-on: windows-2025 + needs: setup + if: github.ref == 'refs/heads/develop' && needs.setup.outputs.backend_changed == 'true' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + persist-credentials: true + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Generate OpenAPI spec + run: ./docs.sh Windows + shell: bash + + - name: Commit and create PR + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config user.email "ci@starosdev.com" + git config user.name "Starosdev CI" + git checkout -b api-docs + git add . + if git diff --cached --quiet; then + echo "No changes since last run" + else + git commit -m "Automated API Docs update" + git push -f --set-upstream origin api-docs + gh pr create --repo Starosdev/Radarr --title "Update API docs" --base develop --head api-docs --body "Automated API documentation update." || echo "PR already exists" + fi + shell: bash + + - name: Upload API docs + uses: actions/upload-artifact@v4 + if: always() + with: + name: api-docs + path: src/Radarr.Api.V3/openapi.json + + # --------------------------------------------------------------------------- + # Discord Notification + # --------------------------------------------------------------------------- + discord-notify: + runs-on: ubuntu-24.04 + needs: + - setup + - build-backend + - build-frontend + - packages + - lint + - unit-test-native + - unit-test-docker + - unit-test-postgres + - integration-native + - integration-docker + - integration-postgres + - installer + - sentry + - sonarcloud-frontend + - sonarcloud-backend + - api-docs + if: always() && github.event_name == 'push' + steps: + - name: Send Discord notification + env: + DISCORD_WEBHOOK_KEY: ${{ secrets.DISCORD_WEBHOOK_KEY }} + DISCORD_CHANNEL_ID: ${{ vars.DISCORD_CHANNEL_ID }} + BRANCH_NAME: ${{ needs.setup.outputs.branch_name }} + RADARR_VERSION: ${{ needs.setup.outputs.radarr_version }} + run: | + if [ "${{ needs.packages.result }}" = "success" ] && \ + [ "${{ needs.build-backend.result }}" = "success" ] && \ + [ "${{ needs.build-frontend.result }}" = "success" ]; then + COLOR=3066993 + STATUS="Succeeded" + else + COLOR=15158332 + STATUS="Failed" + fi + + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + + # Only send if webhook is configured + if [ -n "$DISCORD_WEBHOOK_KEY" ] && [ -n "$DISCORD_CHANNEL_ID" ]; then + curl -s -H "Content-Type: application/json" \ + -d "{ + \"username\": \"GitHub Actions\", + \"embeds\": [{ + \"title\": \"Radarr ${BRANCH_NAME} - ${RADARR_VERSION}\", + \"description\": \"Build ${STATUS}\", + \"url\": \"${RUN_URL}\", + \"color\": ${COLOR}, + \"fields\": [ + {\"name\": \"Branch\", \"value\": \"${BRANCH_NAME}\", \"inline\": true}, + {\"name\": \"Version\", \"value\": \"${RADARR_VERSION}\", \"inline\": true} + ] + }] + }" \ + "https://discord.com/api/webhooks/${DISCORD_CHANNEL_ID}/${DISCORD_WEBHOOK_KEY}" + else + echo "Discord webhook not configured, skipping notification" + fi diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5bb9f297436..6f64ad2a28a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,25 +22,31 @@ variables: linuxImage: 'ubuntu-24.04' macImage: 'macOS-15' -trigger: - branches: - include: - - develop - - master - paths: - exclude: - - .github - - src/Radarr.Api.*/openapi.json +# CI/CD has been migrated to GitHub Actions (.github/workflows/ci.yml) +# Triggers disabled to prevent duplicate builds +trigger: none +pr: none -pr: - branches: - include: - - develop - paths: - exclude: - - .github - - src/NzbDrone.Core/Localization/Core - - src/Radarr.Api.*/openapi.json +# Original trigger configuration (preserved for reference): +# trigger: +# branches: +# include: +# - develop +# - master +# paths: +# exclude: +# - .github +# - src/Radarr.Api.*/openapi.json +# +# pr: +# branches: +# include: +# - develop +# paths: +# exclude: +# - .github +# - src/NzbDrone.Core/Localization/Core +# - src/Radarr.Api.*/openapi.json stages: - stage: Setup From ba7a8a8b1ed805b91e327f0b6972ef87f18d7faf Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 19:51:49 -0400 Subject: [PATCH 02/12] fix(ci): use self-hosted SonarQube instead of SonarCloud (#18) Update sonarcloud-frontend and sonarcloud-backend jobs to use self-hosted SonarQube at sonar.staros.dev with per-project tokens. Remove sonar.organization parameter (not used in SonarQube). --- .github/workflows/ci.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac39f76834f..b29855ad929 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -771,9 +771,9 @@ jobs: fi # --------------------------------------------------------------------------- - # SonarCloud: Frontend analysis + # SonarQube: Frontend analysis # --------------------------------------------------------------------------- - sonarcloud-frontend: + sonarqube-frontend: runs-on: ubuntu-24.04 needs: setup if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository @@ -783,22 +783,21 @@ jobs: with: fetch-depth: 0 - - name: SonarCloud scan + - name: SonarQube scan uses: SonarSource/sonarqube-scan-action@v5 env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }} + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} with: args: > -Dsonar.projectKey=Radarr_Radarr.UI - -Dsonar.organization=radarr -Dsonar.sources=./frontend - -Dsonar.host.url=https://sonarcloud.io -Dsonar.projectVersion=${{ needs.setup.outputs.radarr_version }} # --------------------------------------------------------------------------- - # SonarCloud: Backend analysis with coverage + # SonarQube: Backend analysis with coverage # --------------------------------------------------------------------------- - sonarcloud-backend: + sonarqube-backend: runs-on: windows-2025 needs: setup if: needs.setup.outputs.backend_changed == 'true' @@ -822,16 +821,15 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository run: dotnet tool install --global dotnet-sonarscanner - - name: SonarCloud begin + - name: SonarQube begin if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} run: | dotnet sonarscanner begin \ /k:"Radarr_Radarr" \ - /o:"radarr" \ /d:sonar.token="${SONAR_TOKEN}" \ - /d:sonar.host.url="https://sonarcloud.io" \ + /d:sonar.host.url="${{ vars.SONAR_HOST_URL }}" \ /d:sonar.projectVersion="${{ needs.setup.outputs.radarr_version }}" \ /d:sonar.exclusions="**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**" \ /d:sonar.coverage.exclusions="**/Radarr.Api.V3/**/*" \ @@ -845,11 +843,11 @@ jobs: TEST_DIR=_tests/net8.0/win-x64/publish/ ./test.sh Windows Unit Coverage shell: bash - - name: SonarCloud end + - name: SonarQube end if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} + run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN_BACKEND }}" shell: bash - name: Generate coverage report @@ -928,8 +926,8 @@ jobs: - integration-postgres - installer - sentry - - sonarcloud-frontend - - sonarcloud-backend + - sonarqube-frontend + - sonarqube-backend - api-docs if: always() && github.event_name == 'push' steps: From e0a17c487fe8aeb74d815c071e47b4a6360e3c11 Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 19:54:01 -0400 Subject: [PATCH 03/12] fix(ci): separate Discord webhook ID from channel ID (#18) Use DISCORD_WEBHOOK_ID for constructing the webhook URL and DISCORD_CHANNEL_ID for the actual channel reference. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b29855ad929..eca5f7c52d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -934,7 +934,7 @@ jobs: - name: Send Discord notification env: DISCORD_WEBHOOK_KEY: ${{ secrets.DISCORD_WEBHOOK_KEY }} - DISCORD_CHANNEL_ID: ${{ vars.DISCORD_CHANNEL_ID }} + DISCORD_WEBHOOK_ID: ${{ vars.DISCORD_WEBHOOK_ID }} BRANCH_NAME: ${{ needs.setup.outputs.branch_name }} RADARR_VERSION: ${{ needs.setup.outputs.radarr_version }} run: | @@ -951,7 +951,7 @@ jobs: RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" # Only send if webhook is configured - if [ -n "$DISCORD_WEBHOOK_KEY" ] && [ -n "$DISCORD_CHANNEL_ID" ]; then + if [ -n "$DISCORD_WEBHOOK_KEY" ] && [ -n "$DISCORD_WEBHOOK_ID" ]; then curl -s -H "Content-Type: application/json" \ -d "{ \"username\": \"GitHub Actions\", @@ -966,7 +966,7 @@ jobs: ] }] }" \ - "https://discord.com/api/webhooks/${DISCORD_CHANNEL_ID}/${DISCORD_WEBHOOK_KEY}" + "https://discord.com/api/webhooks/${DISCORD_WEBHOOK_ID}/${DISCORD_WEBHOOK_KEY}" else echo "Discord webhook not configured, skipping notification" fi From 7a27db3418cf70a92bb885e57e6330a66976ea0f Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 20:03:12 -0400 Subject: [PATCH 04/12] fix(ci): resolve actionlint errors in workflow (#18) Fix env context not available at job-level env (use literal values for MAJORVERSION and INNOVERSION). Pass github.head_ref through env var to prevent script injection risk. --- .github/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eca5f7c52d4..a579f0c062c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,9 @@ jobs: id: counter env: MAJOR_VERSION: ${{ env.MAJOR_VERSION }} + HEAD_REF: ${{ github.head_ref }} + REF_NAME: ${{ github.ref_name }} + EVENT_NAME: ${{ github.event_name }} run: | git fetch --tags --force LAST=$(git tag -l 'build-counter-*' | sed 's/build-counter-//' | sort -n | tail -1) @@ -54,10 +57,10 @@ jobs: echo "build_number=$NEXT" >> "$GITHUB_OUTPUT" echo "radarr_version=${MAJOR_VERSION}.${NEXT}" >> "$GITHUB_OUTPUT" - if [ "${{ github.event_name }}" = "pull_request" ]; then - echo "branch_name=${{ github.head_ref }}" >> "$GITHUB_OUTPUT" + if [ "$EVENT_NAME" = "pull_request" ]; then + echo "branch_name=$HEAD_REF" >> "$GITHUB_OUTPUT" else - echo "branch_name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + echo "branch_name=$REF_NAME" >> "$GITHUB_OUTPUT" fi - name: Push build counter tag @@ -695,8 +698,8 @@ jobs: needs: [build-backend, build-frontend, setup] env: RADARRVERSION: ${{ needs.setup.outputs.radarr_version }} - MAJORVERSION: ${{ env.MAJOR_VERSION }} - INNOVERSION: ${{ env.INNO_VERSION }} + MAJORVERSION: '6.1.1' + INNOVERSION: '6.2.2' BUILD_SOURCEBRANCHNAME: ${{ needs.setup.outputs.branch_name }} BUILDNAME: ${{ needs.setup.outputs.branch_name }}.${{ needs.setup.outputs.radarr_version }} steps: From cd606ada9b602489060cd41719abefadb3dc03fe Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 20:09:21 -0400 Subject: [PATCH 05/12] fix(ci): allow workflow changes to trigger CI (#18) Replace blanket .github/** paths-ignore with specific exclusions for labeler, label-actions, and lock workflows. The CI workflow itself must be able to trigger runs when updated. --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a579f0c062c..72c99854989 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,13 +6,17 @@ on: - develop - master paths-ignore: - - '.github/**' + - '.github/workflows/labeler.yml' + - '.github/workflows/label-actions.yml' + - '.github/workflows/lock.yml' - 'src/Radarr.Api.*/openapi.json' pull_request: branches: - develop paths-ignore: - - '.github/**' + - '.github/workflows/labeler.yml' + - '.github/workflows/label-actions.yml' + - '.github/workflows/lock.yml' - 'src/NzbDrone.Core/Localization/Core/**' - 'src/Radarr.Api.*/openapi.json' From f3953cb8852b75177e148a0a04e215be5df17dde Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 20:19:00 -0400 Subject: [PATCH 06/12] fix(ci): resolve build failures from first CI run (#18) - Fix SA1513 StyleCop error in VideoFileInfoReader.cs (missing blank line after closing brace) - Bump Node.js from 20.11.1 to 20.19.0 (jsdom@28.1.0 requires it) - Fix SonarScanner on Windows: Git Bash mangles /k: and /d: flags, switch to pwsh shell for sonarscanner begin/end steps --- .github/workflows/ci.yml | 30 ++++++++++--------- .../MediaInfo/VideoFileInfoReader.cs | 1 + 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72c99854989..45bfb3b3c1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ concurrency: env: MAJOR_VERSION: '6.1.1' DOTNET_VERSION: '8.0.405' - NODE_VERSION: '20.11.1' + NODE_VERSION: '20.19.0' INNO_VERSION: '6.2.2' jobs: @@ -832,17 +832,19 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} - run: | - dotnet sonarscanner begin \ - /k:"Radarr_Radarr" \ - /d:sonar.token="${SONAR_TOKEN}" \ - /d:sonar.host.url="${{ vars.SONAR_HOST_URL }}" \ - /d:sonar.projectVersion="${{ needs.setup.outputs.radarr_version }}" \ - /d:sonar.exclusions="**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**" \ - /d:sonar.coverage.exclusions="**/Radarr.Api.V3/**/*" \ - /d:sonar.cs.cobertura.reportsPaths="$(pwd)/CoverageResults/**/coverage.cobertura.xml" \ - /d:sonar.cs.nunit.reportsPaths="$(pwd)/TestResult.xml" - shell: bash + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} + RADARR_VERSION: ${{ needs.setup.outputs.radarr_version }} + run: >- + dotnet sonarscanner begin + /k:"Radarr_Radarr" + /d:sonar.token="$SONAR_TOKEN" + /d:sonar.host.url="$SONAR_HOST_URL" + /d:sonar.projectVersion="$RADARR_VERSION" + /d:sonar.exclusions="**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**" + /d:sonar.coverage.exclusions="**/Radarr.Api.V3/**/*" + /d:sonar.cs.cobertura.reportsPaths="${{ github.workspace }}/CoverageResults/**/coverage.cobertura.xml" + /d:sonar.cs.nunit.reportsPaths="${{ github.workspace }}/TestResult.xml" + shell: pwsh - name: Build and run coverage tests run: | @@ -854,8 +856,8 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} - run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN_BACKEND }}" - shell: bash + run: dotnet sonarscanner end /d:sonar.token="$env:SONAR_TOKEN" + shell: pwsh - name: Generate coverage report uses: danielpalme/ReportGenerator-GitHub-Action@5 diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index 1bec8e32eec..f6eaadf66d4 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -137,6 +137,7 @@ public MediaInfoModel GetMediaInfo(string filename) sideData = sideData.Concat(dvSideData).ToList(); } } + mediaInfoModel.VideoHdrFormat = GetHdrFormat(mediaInfoModel.VideoBitDepth, mediaInfoModel.VideoColourPrimaries, mediaInfoModel.VideoTransferCharacteristics, sideData); return mediaInfoModel; From 4efebc239165f83e737a6e3ea1c6314a618ce14b Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 20:38:10 -0400 Subject: [PATCH 07/12] fix(ci): resolve test reporter, webpack, and SonarQube issues (#18) - Remove dorny/test-reporter (requires git checkout, test jobs only download artifacts). Test results still uploaded as artifacts. - Exclude .test.tsx files from webpack build (TS errors from Vitest matchers like toBeInTheDocument) - Fix SonarScanner pwsh env var syntax (use $env:VAR instead of $VAR) --- .github/workflows/ci.yml | 15 +++------------ frontend/build/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45bfb3b3c1c..79e64b7904e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -374,15 +374,6 @@ jobs: name: ${{ matrix.test-name }}-unit-test-results path: '**/TestResult.xml' - - name: Report test results - uses: dorny/test-reporter@v1 - if: always() - with: - name: ${{ matrix.test-name }} Unit Tests - path: '**/TestResult.xml' - reporter: java-junit - fail-on-error: true - # --------------------------------------------------------------------------- # Unit Tests: Docker (Alpine / musl) # --------------------------------------------------------------------------- @@ -837,9 +828,9 @@ jobs: run: >- dotnet sonarscanner begin /k:"Radarr_Radarr" - /d:sonar.token="$SONAR_TOKEN" - /d:sonar.host.url="$SONAR_HOST_URL" - /d:sonar.projectVersion="$RADARR_VERSION" + /d:sonar.token="$env:SONAR_TOKEN" + /d:sonar.host.url="$env:SONAR_HOST_URL" + /d:sonar.projectVersion="$env:RADARR_VERSION" /d:sonar.exclusions="**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**" /d:sonar.coverage.exclusions="**/Radarr.Api.V3/**/*" /d:sonar.cs.cobertura.reportsPaths="${{ github.workspace }}/CoverageResults/**/coverage.cobertura.xml" diff --git a/frontend/build/webpack.config.js b/frontend/build/webpack.config.js index 6c244c5af3d..ae04b645f3c 100644 --- a/frontend/build/webpack.config.js +++ b/frontend/build/webpack.config.js @@ -161,7 +161,7 @@ module.exports = (env) => { rules: [ { test: [/\.jsx?$/, /\.tsx?$/], - exclude: /(node_modules|JsLibraries)/, + exclude: /(node_modules|JsLibraries|\.test\.[jt]sx?$)/, use: [ { loader: 'babel-loader', From ea5db0d3ebb76ebb2d7ab5fca1544baf22573eb9 Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 20:44:20 -0400 Subject: [PATCH 08/12] fix: resolve lint errors in frontend test files (#18) - Add explicit boolean values for JSX boolean attributes (ESLint react/jsx-boolean-value rule) - Fix prettier formatting in Icon.test.tsx - Add test infrastructure files to .eslintignore (vitest.config.ts, test/setup.ts, test/cssModuleMock.ts are outside tsconfig scope) --- frontend/.eslintignore | 3 +++ frontend/src/Components/Icon.test.tsx | 8 ++------ frontend/src/Components/Label.test.tsx | 2 +- frontend/src/Components/ProgressBar.test.tsx | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/.eslintignore b/frontend/.eslintignore index e6d49ec4d77..0a9891fcf7e 100644 --- a/frontend/.eslintignore +++ b/frontend/.eslintignore @@ -1,2 +1,5 @@ **/JsLibraries/** **/*.css.d.ts +**/test/setup.ts +**/test/cssModuleMock.ts +vitest.config.ts diff --git a/frontend/src/Components/Icon.test.tsx b/frontend/src/Components/Icon.test.tsx index 61f79ca41d8..8e14a7b444a 100644 --- a/frontend/src/Components/Icon.test.tsx +++ b/frontend/src/Components/Icon.test.tsx @@ -50,11 +50,7 @@ describe('Icon', () => { it('applies containerClassName to the title wrapper span', () => { render( - + ); const span = screen.getByTitle('Test'); @@ -69,7 +65,7 @@ describe('Icon', () => { }); it('renders spinning icon when isSpinning is true', () => { - const { container } = render(); + const { container } = render(); const svg = container.querySelector('svg') as SVGElement; expect(svg.classList.toString()).toContain('spin'); diff --git a/frontend/src/Components/Label.test.tsx b/frontend/src/Components/Label.test.tsx index 254c08289b0..66894a15292 100644 --- a/frontend/src/Components/Label.test.tsx +++ b/frontend/src/Components/Label.test.tsx @@ -31,7 +31,7 @@ describe('Label', () => { }); it('applies outline class when outline is true', () => { - render(); + render(); const el = screen.getByText('Outline'); expect(el.className).toContain('outline'); diff --git a/frontend/src/Components/ProgressBar.test.tsx b/frontend/src/Components/ProgressBar.test.tsx index 5319b942a03..d4ae271484a 100644 --- a/frontend/src/Components/ProgressBar.test.tsx +++ b/frontend/src/Components/ProgressBar.test.tsx @@ -29,13 +29,13 @@ describe('ProgressBar', () => { }); it('shows text when showText is true', () => { - render(); + render(); expect(screen.getByText('50.0%')).toBeInTheDocument(); }); it('shows custom text when provided', () => { - render(); + render(); expect(screen.getByText('Half done')).toBeInTheDocument(); }); From dda5e10ac88404ea122c8828ff77edc37d6b2487 Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 21:08:16 -0400 Subject: [PATCH 09/12] fix(ci): exclude test files from webpack/tsc, fix SonarScanner args (#18) - Exclude *.test.ts/tsx from tsconfig.json so fork-ts-checker-webpack-plugin does not type-check Vitest test files during production build - Fix SonarScanner begin command: use pwsh backtick continuations instead of YAML folding, use /v: for project version per scanner recommendation --- .github/workflows/ci.yml | 20 ++++++++++---------- frontend/tsconfig.json | 4 +++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79e64b7904e..7945e99946a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -825,16 +825,16 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} RADARR_VERSION: ${{ needs.setup.outputs.radarr_version }} - run: >- - dotnet sonarscanner begin - /k:"Radarr_Radarr" - /d:sonar.token="$env:SONAR_TOKEN" - /d:sonar.host.url="$env:SONAR_HOST_URL" - /d:sonar.projectVersion="$env:RADARR_VERSION" - /d:sonar.exclusions="**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**" - /d:sonar.coverage.exclusions="**/Radarr.Api.V3/**/*" - /d:sonar.cs.cobertura.reportsPaths="${{ github.workspace }}/CoverageResults/**/coverage.cobertura.xml" - /d:sonar.cs.nunit.reportsPaths="${{ github.workspace }}/TestResult.xml" + run: | + dotnet sonarscanner begin ` + /k:"Radarr_Radarr" ` + /d:sonar.token="$env:SONAR_TOKEN" ` + /d:sonar.host.url="$env:SONAR_HOST_URL" ` + /v:"$env:RADARR_VERSION" ` + /d:sonar.exclusions="**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**" ` + /d:sonar.coverage.exclusions="**/Radarr.Api.V3/**/*" ` + /d:sonar.cs.cobertura.reportsPaths="${{ github.workspace }}/CoverageResults/**/coverage.cobertura.xml" ` + /d:sonar.cs.nunit.reportsPaths="${{ github.workspace }}/TestResult.xml" shell: pwsh - name: Build and run coverage tests diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 611c872edaa..4cd39f3fcf2 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -32,6 +32,8 @@ "./typings/*.ts", ], "exclude": [ - "node_modules" + "node_modules", + "src/**/*.test.ts", + "src/**/*.test.tsx" ] } From 1fc11bad7d84cd7625c28c6f7d59f98ba0008edb Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 21:28:13 -0400 Subject: [PATCH 10/12] fix(ci): handle missing net8.0-windows output, exclude tests from ESLint (#18) - Make PackageWindows() gracefully skip the net8.0-windows overlay when building on Linux (WinForms tray app only builds on Windows) - Add *.test.ts and *.test.tsx to .eslintignore (test files use Vitest types not included in the main tsconfig project) --- build.sh | 6 +++++- frontend/.eslintignore | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 73e785bebe0..6a9f14a2a52 100755 --- a/build.sh +++ b/build.sh @@ -206,7 +206,11 @@ PackageWindows() local folder=$artifactsFolder/$runtime/$framework/Radarr PackageFiles "$folder" "$framework" "$runtime" - cp -r $outputFolder/$framework-windows/$runtime/publish/* $folder + if [ -d "$outputFolder/$framework-windows/$runtime/publish" ]; then + cp -r $outputFolder/$framework-windows/$runtime/publish/* $folder + else + echo "Skipping Windows-specific overlay (net8.0-windows not built on this platform)" + fi echo "Removing Radarr.Mono" rm -f $folder/Radarr.Mono.* diff --git a/frontend/.eslintignore b/frontend/.eslintignore index 0a9891fcf7e..e66f7f45c07 100644 --- a/frontend/.eslintignore +++ b/frontend/.eslintignore @@ -1,5 +1,7 @@ **/JsLibraries/** **/*.css.d.ts +**/*.test.ts +**/*.test.tsx **/test/setup.ts **/test/cssModuleMock.ts vitest.config.ts From 1d8f15011851bf59fa99d9f95271eb53b2d1f8f6 Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 21:52:53 -0400 Subject: [PATCH 11/12] fix(ci): fix installer and sentry source map upload (#18) - Installer job now builds backend on Windows directly (needs net8.0-windows TFM for Radarr.exe WinForms tray app, which only builds on Windows) - Update sentry-cli source map command from deprecated 'releases files upload-sourcemaps' to 'sourcemaps upload' --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7945e99946a..c456219cfb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -690,7 +690,7 @@ jobs: # --------------------------------------------------------------------------- installer: runs-on: windows-2025 - needs: [build-backend, build-frontend, setup] + needs: [build-frontend, setup] env: RADARRVERSION: ${{ needs.setup.outputs.radarr_version }} MAJORVERSION: '6.1.1' @@ -701,13 +701,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + submodules: true fetch-depth: 1 - - name: Download backend output - uses: actions/download-artifact@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 with: - name: backend-output - path: _output/ + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Build backend on Windows + run: ./build.sh --backend + shell: bash - name: Download frontend output uses: actions/download-artifact@v4 @@ -760,7 +764,7 @@ jobs: run: | RELEASENAME="Radarr@${RADARR_VERSION}-${BRANCH_NAME}" sentry-cli releases new --finalize -p radarr -p radarr-ui -p radarr-update "${RELEASENAME}" - sentry-cli releases -p radarr-ui files "${RELEASENAME}" upload-sourcemaps _output/UI/ --rewrite + sentry-cli sourcemaps upload --release="${RELEASENAME}" -p radarr-ui _output/UI/ sentry-cli releases set-commits --auto "${RELEASENAME}" if [ "${GITHUB_REF}" = "refs/heads/develop" ]; then sentry-cli releases deploys "${RELEASENAME}" new -e nightly From 46322c43f0948356da7ea2242070f7bb72abe765 Mon Sep 17 00:00:00 2001 From: Eder Date: Wed, 18 Mar 2026 22:17:00 -0400 Subject: [PATCH 12/12] fix(ci): add checkout to sentry job for set-commits (#18) sentry-cli releases set-commits --auto needs a git repo to associate commits with the release. --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c456219cfb3..634e2f3a745 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -748,6 +748,11 @@ jobs: SENTRY_ORG: ${{ vars.SENTRY_ORG }} SENTRY_URL: ${{ vars.SENTRY_URL }} steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Download frontend output uses: actions/download-artifact@v4 with: