Skip to content

Commit 25db75c

Browse files
author
cbuahin
committed
Use github actions cache instead of nuget to simplify
1 parent 7fdd0fd commit 25db75c

File tree

1 file changed

+9
-38
lines changed

1 file changed

+9
-38
lines changed

.github/workflows/unit_testing.yml

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
1212
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
1313
NUGET_FEED_URL: https://nuget.pkg.github.com/USEPA/index.json
14-
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/USEPA/index.json,readwrite"
14+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
1515
OMP_NUM_THREADS: 1
1616
BUILD_HOME: build
1717
NUGET_USER_NAME: ${{ secrets.CALEB_NUGET_USER_NAME }}
@@ -73,7 +73,6 @@ jobs:
7373
brew reinstall libomp
7474
brew link --force --overwrite libomp
7575
76-
7776
- name: Bootstrap VCPKG (Windows)
7877
if: ${{ matrix.os == 'windows-latest' }}
7978
working-directory: ${{ env.VCPKG_ROOT }}
@@ -88,46 +87,18 @@ jobs:
8887
./bootstrap-vcpkg${{ matrix.shell_extension }}
8988
chmod +x vcpkg
9089
91-
- name: Install Mono (Linux)
92-
if: ${{ matrix.os == 'ubuntu-latest' }}
93-
run: |
94-
sudo apt-get update
95-
sudo apt-get install -y mono-complete
96-
97-
- name: Install NuGet
98-
uses: nuget/setup-nuget@v2
90+
- name: Export GitHub Actions cache environment variables
91+
uses: actions/github-script@v7
9992
with:
100-
nuget-version: 5.x
93+
script: |
94+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
95+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
10196
102-
- name: Configure Binary Sources (Windows)
103-
if: ${{ matrix.os == 'windows-latest' }}
104-
run: |
105-
.$(${{ env.VCPKG_EXE }} fetch nuget) sources add -Name github -Source ${{ env.NUGET_FEED_URL }} -UserName ${{ env.NUGET_USER_NAME }} -Password ${{ env.NUGET_API_KEY }}
106-
.$(${{ env.VCPKG_EXE }} fetch nuget) setapikey ${{ env.NUGET_API_KEY }} -Source github
107-
.$(${{ env.VCPKG_EXE }} fetch nuget) sources
108-
109-
- name: Configure Binary Sources (Unix like)
110-
if: ${{ matrix.os != 'windows-latest' }}
111-
run: |
112-
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` sources add -Name github -Source ${{ env.NUGET_FEED_URL }} -UserName ${{ env.NUGET_USER_NAME }} -Password ${{ env.NUGET_API_KEY }}
113-
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` setapikey ${{ env.NUGET_API_KEY }} -Source github
114-
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` sources
115-
116-
- name: Install Boost-Test (Windows)
97+
- name: Install Required Libraries (Windows)
11798
if: ${{ matrix.os == 'windows-latest' }}
11899
run: |
119-
.$(${{ env.VCPKG_EXE }} fetch nuget) install boost-test-${{ matrix.vcpkg_triplet }} -Source github || (
120-
${{ env.VCPKG_EXE }} new --application && ${{ env.VCPKG_EXE }} install
121-
)
122-
123-
- name: Install Boost-Test (Unix like)
124-
if: ${{ matrix.os != 'windows-latest' }}
125-
run: |
126-
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` install boost-test-${{ matrix.vcpkg_triplet }} -Source github || (
127-
${{ env.VCPKG_EXE }} new --application && ${{ env.VCPKG_EXE }} install &&
128-
${{ env.VCPKG_EXE }} export boost-test --nuget --nuget-id=boost-test-${{ matrix.vcpkg_triplet }} --output-dir=. &&
129-
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` push boost-test-${{ matrix.vcpkg_triplet }}*.nupkg -Source github -ApiKey ${{ env.NUGET_API_KEY }}
130-
)
100+
${{ env.VCPKG_EXE }} new --application
101+
${{ env.VCPKG_EXE }} install
131102
132103
- name: Build Binaries
133104
env:

0 commit comments

Comments
 (0)