NanoServer MSVC #103
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NanoServer MSVC | |
on: | |
push: | |
branches: | |
- docker-backwards | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
run-nanoserver-msvc-winsdk-x64-build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup environment | |
shell: pwsh | |
run: | | |
set-mppreference -ExclusionPath c:\ | |
set-mppreference -ExclusionExtension *.* | |
set-mppreference -RemediationScheduleDay 8 | |
Set-MpPreference -DisableRealtimeMonitoring $true | |
Set-MpPreference -DisableRemovableDriveScanning $true | |
Set-MpPreference -DisableArchiveScanning $true | |
Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan $true | |
- name: Restore Cached Image TAR | |
uses: actions/cache@v4 | |
with: | |
path: cache-image.tar | |
key: docker-image-${{ runner.os }}-${{ github.sha }} | |
restore-keys: | | |
docker-image-${{ runner.os }}- | |
- name: Load Cached Image | |
shell: pwsh | |
id: load_cache | |
run: | | |
if (Test-Path cache-image.tar) { | |
docker load -i cache-image.tar | |
echo "CACHE_HIT=true" >> $env:GITHUB_ENV | |
} | |
- name: Build Image | |
if: env.CACHE_HIT != 'true' | |
shell: pwsh | |
run: | | |
docker build --isolation process --build-arg "IMPL_COMPRESSION_OPTIONS=-T0 --ultra" --build-arg "IMPL_COMPRESSION_LEVEL=22" -t app:latest . | |
- name: Save Docker Image to TAR | |
if: env.CACHE_HIT != 'true' | |
shell: pwsh | |
run: | | |
docker save -o cache-image.tar app:latest | |
- name: Cache Image TAR | |
if: env.CACHE_HIT != 'true' | |
uses: actions/cache@v4 | |
with: | |
path: cache-image.tar | |
key: docker-image-${{ runner.os }}-${{ github.sha }} | |
restore-keys: | | |
docker-image-${{ runner.os }}- | |
- name: Run Nano Container | |
shell: pwsh | |
run: | | |
docker run --isolation process -di --name orphan app:latest | |
- name: Inspect Nano Container | |
shell: pwsh | |
run: | | |
docker inspect orphan | |
- name: Nano Container - Unpack Artifacts | |
shell: pwsh | |
run: | | |
docker exec orphan pwsh -c "C:\unpack.ps1" | |
- name: Nano Container - Configure CMake Project | |
shell: pwsh | |
run: | | |
docker exec orphan cmake --preset configure-msvc-winsdk | |
- name: Nano Container - Build the Project | |
shell: pwsh | |
run: | | |
docker exec orphan cmake --build --preset build-msvc-winsdk --config Release -- -j 14 | |
- name: Nano Container - Test the Project | |
shell: pwsh | |
run: | | |
docker exec -w "C:\sample\tests\build-ct\src" orphan ctest -C Release --stop-on-failure --verbose |