ci: Cache submodules and fix artifact naming

This commit is contained in:
Tyler Wilding 2020-09-18 14:26:32 -04:00 committed by lightningterror
parent 2a292fdc05
commit 2e9a32e7ec
2 changed files with 34 additions and 9 deletions

View File

@ -53,10 +53,21 @@ jobs:
# echo "$GITHUB_CONTEXT"
# echo ${{ github.event.pull_request.title }}
- name: Checkout Repository & Submodules
- name: Checkout Repository
uses: actions/checkout@v2
- name: Cache Submodules
id: cache-submodules
uses: actions/cache@v2
with:
submodules: true
key: submodules-${{ hashFiles('./.gitmodules') }}
path: |
./3rdparty/xz
./3rdparty/gtest
- name: Checkout Submodules
if: steps.cache-submodules.outputs.cache-hit != 'true'
run: git submodule update --init --recursive
# -- SETUP CCACHE - https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
- name: Prepare ccache timestamp

View File

@ -54,27 +54,41 @@ jobs:
# run: |
# echo "$GITHUB_CONTEXT"
- name: Checkout Repository & Submodules
- name: Checkout Repository
uses: actions/checkout@v2
- name: Cache Submodules
id: cache-submodules
uses: actions/cache@v2
with:
submodules: true
key: submodules-${{ hashFiles('./.gitmodules') }}
path: |
./3rdparty/xz
./3rdparty/gtest
- name: Checkout Submodules
if: steps.cache-submodules.outputs.cache-hit != 'true'
run: git submodule update --init --recursive
- name: Prepare Artifact Git Info
shell: bash
run: |
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
echo "##[set-output name=short-sha;]$(git rev-parse --short "$GITHUB_SHA")"
ARTIFACT_NAME="commit-$(git rev-parse --short "$GITHUB_SHA")"
if [ ${{ github.event_name == 'pull_request' }} ]; then
echo "##[set-output name=file-name-metadata;]pr-${{ github.event.pull_request.number }}"
echo "##[set-output name=short-sha;]$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
if [ ! -z "${{ github.event.pull_request.number }}" ]; then
ARTIFACT_NAME="pr-${{ github.event.pull_request.number }}-commit-$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
fi
else
echo "##[set-output name=file-name-metadata;]commit-$(git rev-parse --short "$GITHUB_SHA")"
echo "##[set-output name=short-sha;]$(git rev-parse --short "$GITHUB_SHA")"
fi
echo "##[set-output name=artifact-metadata;]${ARTIFACT_NAME}"
id: git-vars
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1.0.1
with:
vs-version: 15.0
vs-version: 16.7
- name: Build PCSX2
run: msbuild "buildbot.xml" /m /v:m /fl1 /t:ReleaseAll /p:Platform=${{ matrix.platform }}
@ -83,5 +97,5 @@ jobs:
uses: actions/upload-artifact@v2
continue-on-error: true
with:
name: PCSX2-${{ matrix.platform }}-${{ steps.git-vars.outputs.file-name-metadata }}
name: PCSX2-${{ matrix.platform }}-${{ steps.git-vars.outputs.artifact-metadata }}
path: bin