From afd33b2d4c2e2490c5fe64f71763c3c5339ba1da Mon Sep 17 00:00:00 2001 From: voletro <65332602+voletro@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:28:28 +1000 Subject: [PATCH] Remove Action for LLVM, use action that is already built in. Set GH env variables. --- .github/scripts/setup-system.ps1 | 17 +++++++++++++---- .github/workflows/ci.yml | 6 ------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/scripts/setup-system.ps1 b/.github/scripts/setup-system.ps1 index b2651a40c..2ba78c9cf 100644 --- a/.github/scripts/setup-system.ps1 +++ b/.github/scripts/setup-system.ps1 @@ -107,11 +107,13 @@ else { -# We can't run the installer if running in ci, so we install LLVM through a GitHub Action instead. +# The ci has LLVM installed already, so we instead just set the env variables. if ($ci -eq $True) { Write-Host Write-Host "Running with Ci, skipping LLVM install." -ForegroundColor Yellow -} + + $VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath) + Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n" else { Write-Host Write-Host "Downloading the LLVM installer..." -ForegroundColor Yellow @@ -155,8 +157,15 @@ Remove-Item "$temp\ffmpeg.zip" Write-Host Write-Host "Setting environment variables..." -ForegroundColor Yellow -# Sets environment variable for ffmpeg -[System.Environment]::SetEnvironmentVariable('FFMPEG_DIR', "$HOME\$foldername", [System.EnvironmentVariableTarget]::User) +if ($ci -eq $True) { + # If running in ci, we need to use GITHUB_ENV and GITHUB_PATH instead of the normal PATH env variables, so we set them here + Add-Content $env:GITHUB_ENV "FFMPEG_DIR=$HOME\$foldername`n" + Add-Content $env:GITHUB_PATH "$HOME\$foldername\bin`n" +} +else { + # Sets environment variable for ffmpeg + [System.Environment]::SetEnvironmentVariable('FFMPEG_DIR', "$HOME\$foldername", [System.EnvironmentVariableTarget]::User) +} Write-Host Write-Host "Copying Required .dll files..." -ForegroundColor Yellow diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1ab6a535..d78d7b382 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,12 +95,6 @@ jobs: with: sharedKey: core-v1-${{ hashFiles('**/Cargo.lock') }} - - name: Install LLVM and Clang - if: matrix.platform == 'windows-latest' - uses: KyleMayes/install-llvm-action@v1 - with: - version: '14' - - name: Run 'setup-system.sh' script if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest' run: ./.github/scripts/setup-system.sh