Skip to content

PREQ-3151: Debug gh-action_cache #78

PREQ-3151: Debug gh-action_cache

PREQ-3151: Debug gh-action_cache #78

Workflow file for this run

name: Test
on:
push:
branches: [ master ]
pull_request:
jobs:
build:
runs-on: github-ubuntu-latest-s
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2.4.4
with:
version: 2025.7.12
- name: Cache Python dependencies
id: cache-python
uses: ./
with:
path: |
~/.cache/pip
key: python-${{ runner.os }}-pytest-requests
restore-keys: python-${{ runner.os }}-
environment: dev
- name: Check cache hit result
run: |
echo "Cache hit: ${{ steps.cache-python.outputs.cache-hit }}"
if [ "${{ steps.cache-python.outputs.cache-hit }}" == "true" ]; then
echo "✅ Cache was found and restored"
else
echo "❌ Cache was not found, will need to rebuild"
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest requests
- name: Run tests
run: python -m pytest --version
cache-with-fallback:
runs-on: github-ubuntu-latest-s
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2.4.4
with:
version: 2025.7.12
- name: Cache Go modules with multiple restore keys
id: cache-go
uses: ./
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-${{ runner.os }}-${{ hashFiles('**/go.mod') }}
go-${{ runner.os }}-
fail-on-cache-miss: false
environment: dev
- name: Check Go cache hit result
run: |
echo "Go cache hit: ${{ steps.cache-go.outputs.cache-hit }}"
if [ "${{ steps.cache-go.outputs.cache-hit }}" == "true" ]; then
echo "✅ Go cache was found and restored"
else
echo "❌ Go cache was not found, will need to rebuild"
fi
- name: Create simple Go module
run: |
go mod init example
echo 'package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}' > main.go
- name: Download dependencies
run: go mod download
- name: Build
run: go build -o hello main.go