Skip to content

Commit

Permalink
.github/workflows/*.yml: Various updates, fixes, and syncing with oth…
Browse files Browse the repository at this point in the history
…er branches' versions of the workflows
  • Loading branch information
Stephen G authored and Stephen G committed Apr 23, 2024
1 parent 1e7ce8b commit 6303ae0
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 71 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/Windows-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,25 @@ jobs:
VCPKG_BINARY_SOURCES: 'x-gha,readwrite'
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows
PYTHONHOME: '${{ github.workspace }}/v/packages/python3_x64-windows/tools/python3'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
# for Binary Caching.
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 #v6.4.1
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3

- name: Setup Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1.0
with:
python-version: 3.11

- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
Expand All @@ -65,28 +69,28 @@ jobs:
cmakeVersion: 3.29.2
ninjaVersion: 1.11.1

# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# when it is being run afterward by CMake.
- name: restore-vcpkg
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1
with:
# The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
path: |
${{ env.VCPKG_ROOT }}
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
!${{ env.VCPKG_ROOT }}/installed
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
key: |
${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}
# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# when it is being run afterward by CMake.
- name: restore-vcpkg
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
with:
# The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
path: |
${{ env.VCPKG_ROOT }}
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
!${{ env.VCPKG_ROOT }}/installed
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
key: |
${{ os.release }}-${{ hashFiles( './engine/vcpkg.json' )}}
- name: install-vcpkg
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/vegastrike/vcpkg-local.git ${{ env.VCPKG_ROOT }}
git clone https://github.com/Microsoft/vcpkg.git ${{ env.VCPKG_ROOT }}
${{ env.VCPKG_ROOT }}\bootstrap-vcpkg.bat -disableMetrics
- name: run-build-script
Expand All @@ -101,7 +105,7 @@ jobs:
run: .\script\test.ps1 -Generator ${{ matrix.cmake-generator }} -EnablePIE ${{ matrix.enable-pie }} -BuildType ${{ matrix.build-type }}

- name: Upload test results
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
if: failure()
with:
name: test_results_xml
Expand Down
74 changes: 41 additions & 33 deletions .github/workflows/Windows-Release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows-CI
name: Windows-Release

# Controls when the action will run.
on:
Expand Down Expand Up @@ -37,19 +37,18 @@ jobs:
VCPKG_ROOT: '${{ github.workspace }}/v'
# Tells vcpkg where binary packages are stored.
VCPKG_DEFAULT_BINARY_CACHE: '${{ github.workspace }}/vbincache'
## Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
#VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
# Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
VCPKG_BINARY_SOURCES: 'x-gha,readwrite'
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows
PYTHONHOME: '${{ github.workspace }}/v/packages/python3_x64-windows/tools/python3'
TAG_NAME: '${{ github.ref_name }}'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
# for Binary Caching.
# Also process the `github.sha` value to produce the SHORT_SHA we'll need later
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 #v6.4.1
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const git_sha = context.sha.substring(0, 7)
Expand All @@ -64,40 +63,45 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3

- name: Setup Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1.0
with:
python-version: 3.11

- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash

- name: install-cmake
uses: lukka/get-cmake@359fbae4b163fa01633e6de228fa7f2a31ab1fc7 #v3.26.1
uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa #v3.29.2
with:
cmakeVersion: 3.26.1
cmakeVersion: 3.29.2
ninjaVersion: 1.11.1

# # Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# # when it is being run afterward by CMake.
# - name: restore-vcpkg
# uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1
# with:
# # The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# # built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# # The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
# path: |
# ${{ env.VCPKG_ROOT }}
# !${{ env.VCPKG_ROOT }}/buildtrees
# !${{ env.VCPKG_ROOT }}/packages
# !${{ env.VCPKG_ROOT }}/downloads
# !${{ env.VCPKG_ROOT }}/installed
# # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
# key: |
# ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}
# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# when it is being run afterward by CMake.
- name: restore-vcpkg
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
with:
# The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
path: |
${{ env.VCPKG_ROOT }}
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
!${{ env.VCPKG_ROOT }}/installed
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
key: |
${{ os.release }}-${{ hashFiles( './engine/vcpkg.json' )}}
- name: install-vcpkg
#if: steps.cache.outputs.cache-hit != 'true'
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/vegastrike/vcpkg-local.git ${{ env.VCPKG_ROOT }}
git clone https://github.com/Microsoft/vcpkg.git ${{ env.VCPKG_ROOT }}
${{ env.VCPKG_ROOT }}\bootstrap-vcpkg.bat -disableMetrics
- name: run-build-script
Expand All @@ -111,10 +115,14 @@ jobs:
GTEST_COLOR: 1
run: .\script\test.ps1 -Generator ${{ matrix.cmake-generator }} -EnablePIE ${{ matrix.enable-pie }} -BuildType ${{ matrix.build-type }}

- name: Upload artifacts
uses: skx/github-action-publish-binaries@44887b225ceca96efd8a912d39c09ad70312af31 # master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_EXT: ${{ matrix.ARTIFACT_EXT }}
- name: Upload test results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
if: failure()
with:
path: "${{ github.workspace }}/**/*.zip"
name: test_results_xml
path: ${{github.workspace}}/build/test-results/**/*.xml

#- name: Upload artifacts
# uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
# with:
# path: "${{ github.workspace }}/build/**/*.zip"
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fortify-on-demand-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3

- name: Fortify on Demand Scan
# You may pin to the exact commit or the version.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-actions-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2
submodules: false
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
# run: ctest -V

- name: Upload test results
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
if: failure()
with:
name: test_results_xml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-actions-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2
submodules: false
Expand All @@ -142,7 +142,7 @@ jobs:
IS_RELEASE: 1
run: script/cibuild $FLAGS
- name: Upload the artifacts
uses: skx/github-action-publish-binaries@44887b225ceca96efd8a912d39c09ad70312af31 # master
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_EXT: ${{ matrix.ARTIFACT_EXT }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: brew install openal-soft

- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2
submodules: false
Expand All @@ -92,7 +92,7 @@ jobs:
run: ctest -V

- name: Upload test results
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
if: failure()
with:
name: test_results_xml
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/macos-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'MacOS-CI'
name: 'MacOS-Release'

on:
release:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
run: brew install openal-soft

- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2
submodules: false
Expand Down Expand Up @@ -99,10 +99,14 @@ jobs:
GTEST_COLOR: 1
run: ctest -V

- name: Upload the artifacts
uses: skx/github-action-publish-binaries@44887b225ceca96efd8a912d39c09ad70312af31 # master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_EXT: ${{ matrix.ARTIFACT_EXT }}
- name: Upload test results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
if: failure()
with:
args: "packages/*.${{ matrix.ARTIFACT_EXT }}"
name: test_results_xml
path: ${{github.workspace}}/build/test-results/**/*.xml

#- name: Upload the artifacts
# uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
# with:
# args: "packages/*.${{ matrix.ARTIFACT_EXT }}"

0 comments on commit 6303ae0

Please sign in to comment.