Skip to content

try to use nuget depends #12

try to use nuget depends

try to use nuget depends #12

Workflow file for this run

name: tests
on:
push:
branches:
- develop
- main
- feature/*
pull_request:
branches:
- develop
- main
workflow_call:
workflow_dispatch:
jobs:
windows-tests:
runs-on: windows-2022
env:
USERNAME: nzbgetcom
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/nzbgetcom/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/nzbgetcom/index.json,read"
VCPKG_DEFAULT_TRIPLET: "x64-windows-static"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bootstrap vcpkg
shell: pwsh
run: ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat
- name: Add NuGet sources
shell: pwsh
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ github.token }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ github.token }}" `
-Source "${{ env.FEED_URL }}"
- name: Setup vcpkg packages
run: |
vcpkg install openssl libxml2 zlib boost-json boost-asio boost-test --binarysource="${{ env.VCPKG_BINARY_SOURCES }}"
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} -DBUILD_ONLY_TESTS=ON
cmake --build . --config Release -j 4
- name: Test
run: |
cd build
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: nzbget-windows-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
linux-tests:
if: false
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
run: |
sudo apt-get install cmake libxml2-dev libssl-dev libncurses-dev libboost-all-dev
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
mkdir build
cd build
cmake .. -DBUILD_ONLY_TESTS=ON
cmake --build . --config Release -j 4
- name: Test
run: |
cd build
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: nzbget-linux-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
macos-tests:
if: false
runs-on: macos-14
steps:
- name: Install dependencies
run:
brew install boost openssl@3 cmake
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
mkdir build
cd build
cmake .. -DBUILD_ONLY_TESTS=ON -DDISABLE_CURSES=ON
cmake --build . --config Release -j 4
- name: Test
run: |
cd build
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: nzbget-linux-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5