Repository navigation
101 lines (97 loc) · 3.06 KB
/
Copy pathcache-item-reusable.yml
File metadata and controls
101 lines (97 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# SPDX-FileCopyrightText: © 2025 open-nudge <https://github.com/open-nudge>
# SPDX-FileContributor: szymonmaszke <github@maszke.co>
#
# SPDX-License-Identifier: Apache-2.0
---
name: "Cache Item Reusable"
on:
workflow_call:
inputs:
# PDM INSTALLATION
group:
description: "Group to install, empty means no group, install all"
type: "string"
required: true
core:
description: "Install core dependencies"
type: "boolean"
default: false
all:
description: "Install all dependencies"
type: "boolean"
default: false
# SYSTEM
python-version:
description: "Python version used for caching"
type: "string"
#
# DO NOT EDIT UNTIL end marker
#
# [[[cog
# import cog
# import cogeol
#
# cycle = cogeol.scientific()[-1]["cycle"]
# cog.out(f' default: "{cycle}"')
# ]]]
default: "3.12"
# [[[end]]] (sum: lAlMRZbmJy)
os:
description: "Operating system to cache on"
type: "string"
default: "ubuntu-latest"
# CHECKOUT
ref:
description: "The ref to checkout"
type: "string"
default: ""
permissions: {} # yamllint disable-line rule:braces
jobs:
cache-item-reusable:
name: "Cache Item Reusable"
runs-on: "${{ inputs.os }}"
timeout-minutes: 60
permissions:
contents: "read"
steps:
- name: "Harden Runner"
# yamllint disable rule:line-length
uses: "step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0" # v2.12.0
# yamllint enable rule:line-length
with:
disable-sudo-and-containers: true
egress-policy: "block"
allowed-endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pdm-project.org:443
pdm.fming.dev:443
pypi.org:443
raw.githubusercontent.com:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
- name: "Checkout repository"
# yamllint disable rule:line-length
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4.2.2
# yamllint enable rule:line-length
with:
sparse-checkout: |
LICENSES
.github/actions
.github/actions/pdm-setup
sparse-checkout-cone-mode: true
persist-credentials: false
# Checkout `main` as otherwise the files may not be available
# after initial template usage
ref: "${{ inputs.ref }}"
- name: "Setup PDM and cache"
# yamllint disable rule:line-length
uses: "open-nudge/opentemplate/.github/actions/pdm-setup@main" # zizmor: ignore[unpinned-uses]
# yamllint enable rule:line-length
with:
group: "${{ inputs.group }}"
core: "${{ inputs.core }}"
all: "${{ inputs.all }}"
python-version: "${{ inputs.python-version }}"
...