mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
ci
This commit is contained in:
136
.github/workflows/build-tests.yml
vendored
Normal file
136
.github/workflows/build-tests.yml
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
name: Build Tests
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
actions: write
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
jobs:
|
||||
test-bins:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
include:
|
||||
- os: windows-latest
|
||||
rust_flags: "--features windows"
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: "rust-test-${{ matrix.os }}"
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@cargo-llvm-cov
|
||||
- name: Check lib-rust
|
||||
run: cargo check -p velopack -F async
|
||||
- name: Check lib-nodejs
|
||||
working-directory: src/lib-nodejs
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
npm run test
|
||||
- name: Test Rust
|
||||
run: cargo llvm-cov ${{ matrix.rust_flags }} --cobertura --output-path ./test/coverage.rust.${{ matrix.os }}.xml
|
||||
- name: Upload Coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
files: ./test/coverage.rust.${{ matrix.os }}.xml
|
||||
|
||||
test-vpk:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||
VELOPACK_GITHUB_TEST_TOKEN: ${{ secrets.VELOPACK_GITHUB_TEST_TOKEN }}
|
||||
VELOPACK_B2_TEST_TOKEN: ${{ secrets.VELOPACK_B2_TEST_TOKEN }}
|
||||
VELOPACK_AZ_TEST_TOKEN: ${{ secrets.VELOPACK_AZ_TEST_TOKEN }}
|
||||
steps:
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: |
|
||||
6.0.x
|
||||
8.0.x
|
||||
9.0.x
|
||||
- name: Print dotnet version
|
||||
run: dotnet --info
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install FUSE
|
||||
run: |
|
||||
sudo add-apt-repository universe
|
||||
sudo apt update
|
||||
sudo apt install libfuse2
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
- name: Install squashfs-tools
|
||||
run: brew install squashfs
|
||||
if: ${{ matrix.os == 'macos-latest' }}
|
||||
- name: Install dotnet-coverage
|
||||
run: dotnet tool install -g dotnet-coverage
|
||||
- name: Build .NET
|
||||
run: dotnet build -c Release
|
||||
- uses: caesay/wait-artifact-action@494939e840383463b1686ce3624a8aab059c2c8b
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
max_wait_seconds: 900
|
||||
artifacts: rust-macos-latest,rust-windows-latest,rust-ubuntu-latest
|
||||
verbose: true
|
||||
- name: Download Rust Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: target/release
|
||||
pattern: rust-*
|
||||
merge-multiple: true
|
||||
- name: Azure login
|
||||
uses: azure/login@v2
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
with:
|
||||
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
||||
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
||||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
- name: Test Velopack.Tests
|
||||
run: dotnet test test/Velopack.Tests/Velopack.Tests.csproj --no-build -c Release -l "console;verbosity=detailed;consoleLoggerParameters=ErrorsOnly" -l GithubActions -- RunConfiguration.CollectSourceInformation=true
|
||||
- name: Test Velopack.Packaging.Tests
|
||||
run: dotnet test test/Velopack.Packaging.Tests/Velopack.Packaging.Tests.csproj --no-build -c Release -l "console;verbosity=detailed;consoleLoggerParameters=ErrorsOnly" -l GithubActions -- RunConfiguration.CollectSourceInformation=true
|
||||
- name: Test Velopack.CommandLine.Tests
|
||||
run: dotnet test test/Velopack.CommandLine.Tests/Velopack.CommandLine.Tests.csproj --no-build -c Release -l "console;verbosity=detailed;consoleLoggerParameters=ErrorsOnly" -l GithubActions -- RunConfiguration.CollectSourceInformation=true
|
||||
- name: Upload Cross-Compile Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cross-${{ matrix.os }}
|
||||
path: test/artifacts/*
|
||||
- name: Upload Coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
directory: ./test
|
||||
- uses: caesay/wait-artifact-action@494939e840383463b1686ce3624a8aab059c2c8b
|
||||
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
max_wait_seconds: 900
|
||||
artifacts: cross-macos-latest,cross-ubuntu-latest,cross-windows-latest
|
||||
verbose: true
|
||||
- name: Download Cross Artifacts
|
||||
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: test/artifacts
|
||||
pattern: cross-*
|
||||
merge-multiple: true
|
||||
- name: Test Cross-Compiled Apps
|
||||
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' }}
|
||||
env:
|
||||
VELOPACK_CROSS_ARTIFACTS: true
|
||||
run: dotnet test test/Velopack.Packaging.Tests/Velopack.Packaging.Tests.csproj --no-build -c Release --filter "FullyQualifiedName~RunCrossApp" -l "console;verbosity=detailed;consoleLoggerParameters=ErrorsOnly" -l GithubActions -- RunConfiguration.CollectSourceInformation=true
|
||||
|
||||
Reference in New Issue
Block a user