Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/actions/compile-ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Compile Chaptarr for CI
description: Run the source guards and build the native package and Core test runtime.
runs:
using: composite
steps:
- name: Guard (repo) - no merge-conflict markers
shell: bash
run: |
if git grep -nE '^(<<<<<<<|=======|>>>>>>>)' -- .; then
echo "Merge-conflict markers found in tracked files."
exit 1
fi
python -c "import json; json.load(open('package.json', encoding='utf-8'))"

- name: Guard (version) - package.json and Directory.Build.props in sync
shell: bash
run: python3 build-tools/version_guard.py sync

- name: Guard (version) - no decreases on develop
if: github.ref == 'refs/heads/develop' || github.base_ref == 'develop'
shell: bash
run: |
set -euo pipefail

if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git fetch --no-tags origin "refs/heads/develop:refs/remotes/origin/develop"
COMPARE_REF="origin/develop"
else
COMPARE_REF="$(git describe --tags --match 'v*' --abbrev=0 HEAD 2>/dev/null || true)"

if [[ -z "$COMPARE_REF" ]]; then
echo "No reachable version tag is available for monotonic version comparison."
exit 1
fi
fi

python3 build-tools/version_guard.py monotonic \
--compare-ref "$COMPARE_REF" \
--event-path "$GITHUB_EVENT_PATH"

- name: Guard (version) - version-only commits stay pure
shell: bash
run: |
set -euo pipefail

if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git fetch --no-tags origin "refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}"
COMPARE_REF="origin/${{ github.base_ref }}"
else
COMPARE_REF="$(git describe --tags --match 'v*' --abbrev=0 HEAD 2>/dev/null || true)"

if [[ -z "$COMPARE_REF" ]]; then
echo "No reachable version tag is available for version-only commit hygiene."
exit 1
fi
fi

python3 build-tools/version_guard.py commit-hygiene --compare-ref "$COMPARE_REF"

- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9
with:
dotnet-version: 10.0.x

- name: Cache NuGet packages
if: runner.os == 'Windows'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-${{ runner.arch }}-nuget-${{ hashFiles('src/NuGet.config', 'src/Directory.Packages.props', 'src/Directory.Build.props', 'src/Directory.Build.targets', 'src/Targets/**/*.targets', 'src/Chaptarr.NoTests.sln', 'src/**/*.csproj') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-nuget-

# FFmpeg is intentionally not downloaded in this compile/test workflow.
# Source builds resolve bundled tools first and then the system PATH; explicit
# native packaging owns bundled-tool acquisition and validation.

- name: Restore dependencies
shell: bash
run: |
dotnet restore src/Chaptarr.NoTests.sln
dotnet restore src/Chaptarr.Core.Test/Chaptarr.Core.Test.csproj

- name: Build
shell: bash
run: dotnet build src/Chaptarr.NoTests.sln --configuration Release --no-restore

- name: Build Windows tray host
if: runner.os == 'Windows'
shell: bash
run: dotnet build src/NzbDrone/Chaptarr.csproj --configuration Release

- name: Check Core test runner
shell: bash
run: python3 -m unittest discover -s build-tools -p test_run_core_tests.py

- name: Build Core tests
shell: bash
run: dotnet build src/Chaptarr.Core.Test/Chaptarr.Core.Test.csproj --configuration Release --no-restore

- name: Publish
shell: bash
run: |
dotnet publish src/NzbDrone.Console/Chaptarr.Console.csproj -c Release -f net10.0 -o ./publish/Chaptarr
dotnet publish src/NzbDrone.Update/Chaptarr.Update.csproj -c Release -f net10.0 -o ./publish/Chaptarr/Chaptarr.Update
14 changes: 14 additions & 0 deletions .github/actions/load-ci-runtime/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Load the compiled CI runtime
description: Restore the same-run test payload built on this operating system.
runs:
using: composite
steps:
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9
with:
dotnet-version: 10.0.x
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ci-runtime-${{ runner.os }}
- name: Unpack test and app binaries
shell: bash
run: tar -xf ci-runtime.tar
Loading
Loading