Skip to content
Merged
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
69 changes: 66 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-2019, macos-10.15]

env:
BUILD_FRAGMENT: bin/Release/netcoreapp3.1

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -25,13 +29,72 @@ jobs:
with:
dotnet-version: 3.1.302

- name: Install Dependencies
- name: Install dependencies
run: dotnet restore
env:
DOTNET_NOLOGO: 1

- name: Build
run: dotnet build --configuration Release --no-restore
run: dotnet build --configuration Release --no-restore -p:UseAppHost=true # Force generation of executable on macOS.

- name: Unit Test
- name: Unit test
run: dotnet test --no-restore

- name: Setup platform (Linux)
if: runner.os == 'Linux'
run: echo "::set-env name=BUILD_PLATFORM::${{ runner.os }}"

- name: Setup platform (Mac)
if: runner.os == 'macOS'
run: echo '::set-env name=BUILD_PLATFORM::Mac'

- name: Setup platform (Windows)
if: runner.os == 'Windows'
run: |
echo "::set-env name=BUILD_PLATFORM::${{ runner.os }}"
echo '::set-env name=BUILD_FILE_EXT::.exe'
Comment on lines +53 to +55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had trouble getting this to work on Windows in GCM Core. Making a note to see why this is different from my attempt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I futzed around a lot with these Actions workflow commands and while I've forgotten some of the details, it was not as straightforward as I might have naively hoped. I recall wanting to do something more elaborate but being unable to get it to work.


- name: Setup Git installer
shell: bash
run: |
GIT_VERSION=$(grep '<GitPackageVersion>' Directory.Build.props | grep -Eo '[0-9.]+(-\w+)*')
cd ../out
dotnet new classlib -n Scalar.GitInstaller
cd Scalar.GitInstaller
cp ../../scalar/nuget.config .
dotnet add Scalar.GitInstaller.csproj package "GitFor${BUILD_PLATFORM}.GVFS.Installer" --package-directory . --version "$GIT_VERSION"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the difference is how you use ${ } here. Interesting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be ... I was able to use a plain $BUILD_FILE_EXT below, though, so I don't know.


- name: Install Git (Linux)
if: runner.os == 'Linux'
run: |
cd ../out/Scalar.GitInstaller
sudo apt-get install -y $(find . -type f -name '*.deb')

- name: Install Git (Mac)
if: runner.os == 'macOS'
run: |
cd ../out/Scalar.GitInstaller
sudo /usr/sbin/installer -pkg $(find . -type f -name '*.pkg') -target /

- name: Install Git (Windows)
if: runner.os == 'Windows'
run: |
Set-Location -Path ..\out\Scalar.GitInstaller
Write-Host 'Uninstalling Git ...'
foreach ($file in Get-ChildItem 'C:\Program Files\Git' -Recurse -File -Include 'unins*.exe') {
& $file.Fullname /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
Wait-Process -Name $file.Basename
}
Remove-Item 'C:\Program Files\Git' -Recurse -Force
Write-Host 'Installing GitForWindows ...'
$files = Get-ChildItem . -Recurse -File -Include 'Git-*.vfs.*.exe'
& $files[0].Fullname /DIR="C:\Program Files\Git" /NOICONS /COMPONENTS="ext,ext\shellhere,ext\guihere,assoc,assoc_sh" /GROUP="Git" /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /ALLOWDOWNGRADE=1 /LOG=install.log
Wait-Process $files[0].Basename
Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\GitForWindows'

- name: Functional test
shell: bash
run: |
cd ../out
PATH="$PWD/Scalar/$BUILD_FRAGMENT:$PWD/Scalar.Service/$BUILD_FRAGMENT:$PATH"
Scalar.FunctionalTests/$BUILD_FRAGMENT/Scalar.FunctionalTests$BUILD_FILE_EXT --test-scalar-on-path --full-suite