Files
duplicati/.github/workflows/freebsd.yml
2022-09-29 21:36:51 -07:00

144 lines
6.0 KiB
YAML

name: Freebsd
on:
push:
branches: "**freebsd**"
pull_request:
branches: "**freebsd**"
jobs:
zip:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- name: Download dotnet
# See also https://github.com/sec/dotnet-core-freebsd-source-build
# See also https://github.com/Thefrank/dotnet-freebsd-crossbuild
run: curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/v6.0.401-11/dotnet-sdk-6.0.401-freebsd-x64.tar.gz -o dn.tgz
- name: Build
id: test
uses: vmactions/freebsd-vm@v0
with:
usesh: true
# sync: sshfs
prepare: pkg install -y curl libinotify libunwind git cmake ninja bash wget icu
run: |
#!/bin/bash
set -x
set -e
pwd
ls -lah
whoami
env
freebsd-version
df -h
dmesg | grep memory
swapinfo
dd if=/dev/zero of=/root/swap1 bs=1m count=20480
chmod 0600 /root/swap1
mdconfig -a -t vnode -f /root/swap1 -u 0
swapon /dev/md0
df -h
swapinfo
export DOTNET_CLI_TELEMETRY_OPTOUT=1
BUILD_DIR=`pwd`
cd /var/tmp
mkdir dn
cd dn
echo Unpacking .NET
tar -xzf ${BUILD_DIR}/dn.tgz
cd ${BUILD_DIR}
mkdir /var/tmp/nuget
export RVERSION=v6.0.401-11
export VERSION=6.0.9
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.AspNetCore.App.Runtime.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.AspNetCore.App.Runtime.freebsd-x64.${VERSION}.nupkg
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.NETCore.App.Host.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.NETCore.App.Host.freebsd-x64.${VERSION}.nupkg
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.NETCore.App.Runtime.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.NETCore.App.Runtime.freebsd-x64.${VERSION}.nupkg
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.NETCore.App.Crossgen2.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.NETCore.App.Crossgen2.freebsd-x64.${VERSION}.nupkg
/var/tmp/dn/dotnet nuget add source /var/tmp/nuget/
cp -R `pwd` /var/tmp/build
cd /var/tmp/build
echo Restore
/var/tmp/dn/dotnet restore --runtime=freebsd-x64 Duplicati.sln
echo Build
/var/tmp/dn/dotnet build Duplicati.sln
echo Publish
/var/tmp/dn/dotnet publish -c Release --runtime=freebsd-x64 -o publish Duplicati.sln
cp -R ./publish ${BUILD_DIR}/publish
- name: Save Artifacts
uses: actions/upload-artifact@v2
with:
name: duplicati-freebsd-x64
path: publish
tests:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- name: Download dotnet
# See also https://github.com/sec/dotnet-core-freebsd-source-build
# See also https://github.com/Thefrank/dotnet-freebsd-crossbuild
run: curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/v6.0.401-11/dotnet-sdk-6.0.401-freebsd-x64.tar.gz -o dn.tgz
- name: Run test
id: test
uses: vmactions/freebsd-vm@v0
with:
usesh: true
# sync: sshfs
prepare: pkg install -y curl libinotify libunwind git cmake ninja bash wget icu
run: |
#!/bin/bash
set -x
set -e
pwd
ls -lah
whoami
env
freebsd-version
df -h
dmesg | grep memory
swapinfo
dd if=/dev/zero of=/root/swap1 bs=1m count=20480
chmod 0600 /root/swap1
mdconfig -a -t vnode -f /root/swap1 -u 0
swapon /dev/md0
df -h
swapinfo
export DOTNET_CLI_TELEMETRY_OPTOUT=1
BUILD_DIR=`pwd`
cd /var/tmp
mkdir dn
cd dn
echo Unpacking .NET
tar -xzf ${BUILD_DIR}/dn.tgz
cd ${BUILD_DIR}
mkdir /var/tmp/nuget
export RVERSION=v6.0.401-11
export VERSION=6.0.9
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.AspNetCore.App.Runtime.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.AspNetCore.App.Runtime.freebsd-x64.${VERSION}.nupkg
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.NETCore.App.Host.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.NETCore.App.Host.freebsd-x64.${VERSION}.nupkg
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.NETCore.App.Runtime.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.NETCore.App.Runtime.freebsd-x64.${VERSION}.nupkg
curl -L https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/${RVERSION}/Microsoft.NETCore.App.Crossgen2.freebsd-x64.${VERSION}.nupkg -o /var/tmp/nuget/Microsoft.NETCore.App.Crossgen2.freebsd-x64.${VERSION}.nupkg
/var/tmp/dn/dotnet nuget add source /var/tmp/nuget/
cp -R `pwd` /var/tmp/build
cd /var/tmp/build
echo Restore
/var/tmp/dn/dotnet restore --runtime=freebsd-x64 Duplicati.sln
echo Testing
mkdir -p ${BUILD_DIR}/duplicati_testdata/logs
mkdir -p /var/tmp/duplicati_testdata
ln -s ${BUILD_DIR}/duplicati_testdata/logs /var/tmp/duplicati_testdata/logs
export UNITTEST_BASEFOLDER=/var/tmp/duplicati_testdata
/var/tmp/dn/dotnet test --runtime=freebsd-x64 --verbosity minimal Duplicati.sln
- name: Archive Test Logs
if: always()
uses: actions/upload-artifact@v2
with:
name: test-logs
path: duplicati_testdata/logs/*