Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add repository variable NOCACHE to disable CI-build caching #418

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: cache-status
description: 'Get cache status'

inputs:
path:
description: 'list of path for cache'
default: ''
key:
description: 'cache key'
default: ''
outputs:
cache-hit:
description: 'output cache-hit'
value: ${{ steps.cachecmd.outputs.cache-hit }}
runs:
using: composite
steps:
- name: Cache Optional Dependencies
if: vars.NOCACHE != 'true'
uses: actions/cache@v4
id: cachecmd
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
- name: output value
if: vars.NOCACHE == 'true'
run: |
echo "steps.cachecmd.outputs.cache-hit=false" >> $GITHUB_OUTPUT
shell: bash
50 changes: 25 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jobs:
# Build optional dependencies (zlib, openssl, libssh) #
##########################################################################
- name: Cache Optional Dependencies
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-optional-dependencies
with:
path: |
Expand Down Expand Up @@ -355,23 +355,23 @@ jobs:
shell: powershell

- name: Build zlib (x86/x86-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64')
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && (matrix.arch == 'x86' || matrix.arch == 'x64')
shell: cmd
run: |
cd zlib\${{env.ZLIB_VERSION}}
cmake .
nmake -f win32\Makefile.msc

- name: Build zlib (arm32/arm64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x64_arm' || matrix.arch == 'x64_arm64')
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && (matrix.arch == 'x64_arm' || matrix.arch == 'x64_arm64')
shell: cmd
run: |
cd zlib\${{env.ZLIB_VERSION}}
cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
nmake

- name: Build openssl (x86)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x86'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && matrix.arch == 'x86'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
Expand All @@ -387,7 +387,7 @@ jobs:
${{env.OPENSSL_MAKE}}

- name: Build openssl (x86-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && matrix.arch == 'x64'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
Expand All @@ -403,7 +403,7 @@ jobs:
${{env.OPENSSL_MAKE}}

- name: Build openssl (ARM)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && matrix.arch == 'x64_arm'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
Expand All @@ -414,7 +414,7 @@ jobs:
${{env.OPENSSL_MAKE}}

- name: Build openssl (ARM-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm64'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && matrix.arch == 'x64_arm64'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
Expand All @@ -424,7 +424,7 @@ jobs:
${{env.OPENSSL_MAKE}}

- name: Build libssh (x86/x86-64, Vista+)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64')
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && (matrix.arch == 'x86' || matrix.arch == 'x64')
shell: cmd
env:
ROOT: ${{ github.workspace }}
Expand All @@ -442,7 +442,7 @@ jobs:
call build.bat /M out /C /R /W ${{env.LIBSSH_VERSION}}

- name: Build libssh (x86/x86-64, Vista+, GSSAPI)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64')
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && (matrix.arch == 'x86' || matrix.arch == 'x64')
shell: cmd
env:
ROOT: ${{ github.workspace }}
Expand All @@ -463,7 +463,7 @@ jobs:
call build.bat /M out /N g /G /C /R /W ${{env.LIBSSH_VERSION}}

- name: Build libssh (x86/x86-64, XP)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64') && (matrix.toolset == '14.0' || matrix.toolset == '14.1' || matrix.toolset == '14.2')
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && (matrix.arch == 'x86' || matrix.arch == 'x64') && (matrix.toolset == '14.0' || matrix.toolset == '14.1' || matrix.toolset == '14.2')
shell: cmd
env:
ROOT: ${{ github.workspace }}
Expand All @@ -483,7 +483,7 @@ jobs:
call build.bat /M out /N x /C /R /X ${{env.LIBSSH_VERSION}}

- name: Build libssh (x86/x86-64, XP, GSSAPI)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64') && (matrix.toolset == '14.0' || matrix.toolset == '14.1' || matrix.toolset == '14.2')
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && (matrix.arch == 'x86' || matrix.arch == 'x64') && (matrix.toolset == '14.0' || matrix.toolset == '14.1' || matrix.toolset == '14.2')
shell: cmd
env:
ROOT: ${{ github.workspace }}
Expand All @@ -506,7 +506,7 @@ jobs:
# zlib is currently disabled for ARM builds as it doesn't currently build for ARM
# On ARM32 we've got to specify the list of standard libraries ourselves as for some unknown reason advapi32.lib gets left off by default.
- name: Build libssh (arm32)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && matrix.arch == 'x64_arm'
shell: powershell
run: |
cd libssh\${{env.LIBSSH_VERSION}}\build
Expand All @@ -515,15 +515,15 @@ jobs:

# zlib is currently disabled for ARM builds as it doesn't currently build for ARM
- name: Build libssh (arm64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm64'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && matrix.arch == 'x64_arm64'
shell: powershell
run: |
cd libssh\${{env.LIBSSH_VERSION}}\build
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=${{github.workspace}}\openssl\${{env.OPENSSL_ARM_VERSION}}\ -DZLIB_ROOT:PATH=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}} -DWITH_DSA=ON
nmake

- name: Build libdes
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true')
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom
Expand All @@ -533,7 +533,7 @@ jobs:
call mknt.bat

- name: Build Regina REXX (x86)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x86'
if: (vars.NOCACHE != '' || steps.cache-optional-dependencies.outputs.cache-hit != 'true') && matrix.arch == 'x86'
shell: cmd
run: |
set REGINA_SRCDIR=${{github.workspace}}\rexx\regina
Expand Down Expand Up @@ -591,7 +591,7 @@ jobs:
# TODO: Regina REXX 3.9.6 doesn't support being cross-compiled to
# an incompatible target architecture:
#
# .\trexx D:\a\ckwin\ckwin\rexx\regina\common\fixrc.rexx D:\a\ckwin\ckwin\rexx\regina\rexxwinexe.rc .\rexxexe.rc 3.9.6 arm64 regina "29 Apr 2024"
# .\trexx D:\a\ckwin\ckwin\rexx\regina\common\fixrc.rexx D:\a\ckwin\ckwin\rexx\regina\rexxwinexe.rc .\rexxexe.rc 3.9.6 arm64 regina "29 Apr 2024"
# NMAKE : fatal error U1045: spawn failed for '.\trexx.EXE' : 0x800700d8
# This version of %1 is not compatible with the version of Windows
# you're running. Check your computer's system information and then
Expand Down Expand Up @@ -786,7 +786,7 @@ jobs:
# Fetch the compiler #
##########################################################################
- name: Cache Compiler
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-compiler
with:
path: |
Expand Down Expand Up @@ -818,7 +818,7 @@ jobs:
# Build optional dependencies (openssl, libdes) #
##########################################################################
- name: Cache Optional Dependencies
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-optional-dependencies
with:
path: |
Expand Down Expand Up @@ -1040,7 +1040,7 @@ jobs:
# Cache Open Watcom because it takes quite a while to download and
# decompress.
- name: Cache openzinc
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-openzinc
with:
path: |
Expand Down Expand Up @@ -1254,7 +1254,7 @@ jobs:
with:
version: "1.9"
- name: Cache dependencies
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-dependencies
with:
path: |
Expand Down Expand Up @@ -1427,7 +1427,7 @@ jobs:
# quite a while to download and decompress and I don't want my FTP
# server being hit constantly to download this whenever a build runs.
- name: Cache VCT2003
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-vct2003
with:
path: |
Expand Down Expand Up @@ -1455,7 +1455,7 @@ jobs:
shell: powershell

- name: Cache legacy dependencies
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-legacy-deps
if: matrix.legacy_dependencies == 'yes'
with:
Expand Down Expand Up @@ -1824,7 +1824,7 @@ jobs:
# quite a while to download and decompress and I don't want my FTP
# server being hit constantly to download this whenever a build runs.
- name: Cache VCT2003+libdes
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-vct2003
with:
path: |
Expand Down Expand Up @@ -1960,7 +1960,7 @@ jobs:
run: sudo apt install -y g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix binutils-mingw-w64-x86-64

- name: Cache Dependencies
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-dependencies
with:
path: |
Expand Down Expand Up @@ -2053,7 +2053,7 @@ jobs:
# Cache the C-Kermit code so that we're not hitting the C-Kermit website
# for every build.
- name: Cache code
uses: actions/cache@v4
uses: "./.github/actions/cache"
id: cache-code
with:
path: |
Expand Down
Loading