Skip to content

Commit 9829ce8

Browse files
authored
Merge pull request #112 from awslabs/fix/workflow-failures
fix: resolve workflow failures in SBOM, Advanced Metrics, Pages, and Manifests
2 parents 737d29c + 521bb89 commit 9829ce8

12 files changed

Lines changed: 100 additions & 89 deletions

File tree

.github/actions/setup-python-uv/action.yml renamed to .github/actions/setup-uv-fresh/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'Setup Python and UV'
2-
description: 'Setup Python, UV, generate pyproject.toml, and install dependencies'
1+
name: 'Setup UV Fresh'
2+
description: 'Setup Python, UV, generate pyproject.toml, and install dependencies from scratch'
33
inputs:
44
python-version:
55
description: 'Python version to setup'

.github/workflows/advanced-metrics.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,18 @@ jobs:
1818
name: Configuration
1919
uses: ./.github/workflows/shared-config.yml
2020

21+
setup-cache:
22+
name: Setup Cache
23+
needs: config
24+
uses: ./.github/workflows/cache-management.yml
25+
with:
26+
cache-type: dependencies
27+
cache-key-base: metrics-deps
28+
python-version: ${{ needs.config.outputs.default-python-version }}
29+
2130
metrics:
2231
name: Generate Advanced Metrics
23-
needs: config
32+
needs: [config, setup-cache]
2433
runs-on: ubuntu-latest
2534
permissions:
2635
contents: read
@@ -30,15 +39,11 @@ jobs:
3039
- name: Checkout code
3140
uses: actions/checkout@v6.0.1
3241

33-
- name: Set up Python
34-
uses: actions/setup-python@v5
35-
with:
36-
python-version: ${{ needs.config.outputs.default-python-version }}
37-
38-
- name: Cache management
39-
uses: ./.github/workflows/cache-management.yml
42+
- name: Setup Python and UV
43+
uses: ./.github/actions/setup-uv-cached
4044
with:
41-
python-version: ${{ needs.config.outputs.default-python-version }}
45+
cache-key: ${{ needs.setup-cache.outputs.cache-key }}
46+
fail-on-cache-miss: false
4247

4348
- name: Install dependencies
4449
run: |

.github/workflows/changelog-validation.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
get-config:
14+
config:
1515
name: Get Configuration
1616
runs-on: ubuntu-latest
1717
permissions:
@@ -27,17 +27,17 @@ jobs:
2727

2828
setup-cache:
2929
name: Setup Cache
30-
needs: get-config
30+
needs: config
3131
uses: ./.github/workflows/cache-management.yml
3232
with:
3333
cache-type: dependencies
3434
cache-key-base: changelog-validation
35-
python-version: ${{ needs.get-config.outputs.default-python-version }}
35+
python-version: ${{ needs.config.outputs.default-python-version }}
3636

3737
validate-changelog:
3838
name: Validate Changelog Format
3939
runs-on: ubuntu-latest
40-
needs: [get-config, setup-cache]
40+
needs: [config, setup-cache]
4141
permissions:
4242
contents: read
4343

.github/workflows/ci-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
fetch-depth: 0
5353

5454
- name: Setup Python and UV
55-
uses: ./.github/actions/setup-python-uv
55+
uses: ./.github/actions/setup-uv-fresh
5656
with:
5757
python-version: ${{ needs.config.outputs.default-python-version }}
5858
cache-key-suffix: quality

.github/workflows/dependabot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16-
get-config:
16+
config:
1717
name: Get Configuration
1818
runs-on: ubuntu-latest
1919
outputs:
@@ -28,18 +28,18 @@ jobs:
2828

2929
setup-cache:
3030
name: Setup Cache
31-
needs: get-config
31+
needs: config
3232
uses: ./.github/workflows/cache-management.yml
3333
with:
3434
cache-type: dependencies
3535
cache-key-base: dependabot
36-
python-version: ${{ needs.get-config.outputs.default-python-version }}
36+
python-version: ${{ needs.config.outputs.default-python-version }}
3737

3838
update-uv-lock:
3939
name: Update UV Lock File
4040
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
4141
runs-on: ubuntu-latest
42-
needs: [get-config, setup-cache]
42+
needs: [config, setup-cache]
4343
permissions:
4444
contents: write
4545
pull-requests: write
@@ -179,7 +179,7 @@ jobs:
179179
name: Monthly Maintenance
180180
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
181181
runs-on: ubuntu-latest
182-
needs: [get-config, setup-cache]
182+
needs: [config, setup-cache]
183183
permissions:
184184
contents: write
185185
pull-requests: write

.github/workflows/dev-pypi.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ concurrency:
3939
cancel-in-progress: false
4040

4141
jobs:
42-
get-config:
42+
config:
4343
name: Get Configuration
4444
runs-on: ubuntu-latest
4545
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
@@ -58,10 +58,10 @@ jobs:
5858
publish:
5959
name: Build and Publish Package
6060
runs-on: ubuntu-latest
61-
needs: [get-config]
61+
needs: [config]
6262
environment:
6363
name: testpypi
64-
url: https://test.pypi.org/p/${{ needs.get-config.outputs.pypi-name }}
64+
url: https://test.pypi.org/p/${{ needs.config.outputs.pypi-name }}
6565
permissions:
6666
id-token: write # IMPORTANT: mandatory for trusted publishing
6767
contents: read # needed to checkout code
@@ -75,15 +75,15 @@ jobs:
7575
- name: Determine version and target
7676
run: |
7777
{
78-
echo "VERSION=${{ needs.get-config.outputs.package-version }}"
78+
echo "VERSION=${{ needs.config.outputs.package-version }}"
7979
echo "TARGET=testpypi"
8080
} >> "$GITHUB_ENV"
8181
echo "Publishing to: TestPyPI with version: $VERSION"
8282
8383
- name: Setup Python and UV
8484
uses: ./.github/actions/setup-uv-cached
8585
with:
86-
cache-key: deps-${{ needs.get-config.outputs.default-python-version }}-${{ hashFiles('.project.yml', 'pyproject.toml', 'requirements*.txt') }}
86+
cache-key: deps-${{ needs.config.outputs.default-python-version }}-${{ hashFiles('.project.yml', 'pyproject.toml', 'requirements*.txt') }}
8787
fail-on-cache-miss: false
8888

8989
- name: Build package
@@ -107,7 +107,7 @@ jobs:
107107
echo "## Package Published Successfully"
108108
echo ""
109109
echo "**Environment:** Test PyPI"
110-
echo "**Installation:** \`pip install --index-url https://test.pypi.org/simple/ ${{ needs.get-config.outputs.pypi-name }}\`"
110+
echo "**Installation:** \`pip install --index-url https://test.pypi.org/simple/ ${{ needs.config.outputs.pypi-name }}\`"
111111
echo ""
112112
echo "**Version:** $VERSION"
113113
echo "**Commands:**"
@@ -117,7 +117,7 @@ jobs:
117117
generate-sbom:
118118
name: Generate SBOM
119119
runs-on: ubuntu-latest
120-
needs: [get-config, publish]
120+
needs: [config, publish]
121121

122122
permissions:
123123
contents: read
@@ -131,7 +131,7 @@ jobs:
131131
- name: Setup Python and UV
132132
uses: ./.github/actions/setup-uv-cached
133133
with:
134-
cache-key: deps-${{ needs.get-config.outputs.default-python-version }}-${{ hashFiles('.project.yml', 'pyproject.toml', 'requirements*.txt') }}
134+
cache-key: deps-${{ needs.config.outputs.default-python-version }}-${{ hashFiles('.project.yml', 'pyproject.toml', 'requirements*.txt') }}
135135
fail-on-cache-miss: false
136136

137137
- name: Generate SBOM files
@@ -141,7 +141,7 @@ jobs:
141141
- name: Upload SBOM artifacts
142142
uses: actions/upload-artifact@v4
143143
with:
144-
name: reports-sbom-${{ needs.get-config.outputs.package-version }}
144+
name: reports-sbom-${{ needs.config.outputs.package-version }}
145145
path: |
146146
python-sbom-cyclonedx.json
147147
python-sbom-spdx.json

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ concurrency:
3434
cancel-in-progress: false
3535

3636
jobs:
37-
get-config:
37+
config:
3838
name: Get Configuration
3939
runs-on: ubuntu-latest
4040
outputs:
@@ -48,15 +48,15 @@ jobs:
4848

4949
setup-cache:
5050
name: Setup Cache
51-
needs: get-config
51+
needs: config
5252
uses: ./.github/workflows/cache-management.yml
5353
with:
5454
cache-type: dependencies
5555
cache-key-base: docs-deps
56-
python-version: ${{ needs.get-config.outputs.default-python-version }}
56+
python-version: ${{ needs.config.outputs.default-python-version }}
5757

5858
build:
59-
needs: [get-config, setup-cache]
59+
needs: [config, setup-cache]
6060
runs-on: ubuntu-latest
6161
steps:
6262
- name: Checkout

.github/workflows/prod-release.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ concurrency:
2121
cancel-in-progress: false
2222

2323
jobs:
24-
get-config:
24+
config:
2525
name: Get Configuration
2626
runs-on: ubuntu-latest
2727
outputs:
@@ -42,14 +42,14 @@ jobs:
4242

4343
prod-containers:
4444
name: Build Production Containers
45-
needs: get-config
45+
needs: config
4646
runs-on: ubuntu-latest
4747
strategy:
4848
matrix:
49-
python-version: ${{ fromJSON(needs.get-config.outputs.python-versions) }}
49+
python-version: ${{ fromJSON(needs.config.outputs.python-versions) }}
5050

5151
env:
52-
SCAN_LEVEL: ${{ matrix.python-version == needs.get-config.outputs.default-python-version && 'full' || 'basic' }}
52+
SCAN_LEVEL: ${{ matrix.python-version == needs.config.outputs.default-python-version && 'full' || 'basic' }}
5353
PUSH_TO_REGISTRY: true
5454

5555
permissions:
@@ -69,26 +69,26 @@ jobs:
6969
- name: Log in to Container Registry
7070
uses: docker/login-action@v3
7171
with:
72-
registry: ${{ needs.get-config.outputs.container-registry }}
72+
registry: ${{ needs.config.outputs.container-registry }}
7373
username: ${{ github.actor }}
7474
password: ${{ secrets.GITHUB_TOKEN }}
7575

7676
- name: Setup Python and UV
7777
uses: ./.github/actions/setup-uv-cached
7878
with:
79-
cache-key: prod-${{ needs.get-config.outputs.package-version }}-py${{ matrix.python-version }}
79+
cache-key: prod-${{ needs.config.outputs.package-version }}-py${{ matrix.python-version }}
8080
fail-on-cache-miss: false
8181

8282
- name: Build package wheel
8383
run: make build
8484

8585
- name: Build and scan container image
8686
env:
87-
REGISTRY: ${{ needs.get-config.outputs.container-registry }}
88-
IMAGE_NAME: ${{ needs.get-config.outputs.container-image }}
89-
VERSION: ${{ needs.get-config.outputs.package-version }}
87+
REGISTRY: ${{ needs.config.outputs.container-registry }}
88+
IMAGE_NAME: ${{ needs.config.outputs.container-image }}
89+
VERSION: ${{ needs.config.outputs.package-version }}
9090
PYTHON_VERSION: ${{ matrix.python-version }}
91-
DEFAULT_PYTHON: ${{ needs.get-config.outputs.default-python-version }}
91+
DEFAULT_PYTHON: ${{ needs.config.outputs.default-python-version }}
9292
run: |
9393
make container single push \
9494
REGISTRY="$REGISTRY" \
@@ -98,7 +98,7 @@ jobs:
9898
9999
prod-manifests:
100100
name: Create Production Manifests
101-
needs: [get-config, prod-containers]
101+
needs: [config, prod-containers]
102102
runs-on: ubuntu-latest
103103
permissions:
104104
contents: read
@@ -111,20 +111,20 @@ jobs:
111111
- name: Log in to Container Registry
112112
uses: docker/login-action@v3
113113
with:
114-
registry: ${{ needs.get-config.outputs.container-registry }}
114+
registry: ${{ needs.config.outputs.container-registry }}
115115
username: ${{ github.actor }}
116116
password: ${{ secrets.GITHUB_TOKEN }}
117117

118118
- name: Create production tag manifests
119119
env:
120-
REGISTRY: ${{ needs.get-config.outputs.container-registry }}
121-
IMAGE: ${{ needs.get-config.outputs.container-image }}
122-
VERSION: ${{ needs.get-config.outputs.package-version }}
123-
DEFAULT_PYTHON: ${{ needs.get-config.outputs.default-python-version }}
120+
REGISTRY: ${{ needs.config.outputs.container-registry }}
121+
IMAGE: ${{ needs.config.outputs.container-image }}
122+
VERSION: ${{ needs.config.outputs.package-version }}
123+
DEFAULT_PYTHON: ${{ needs.config.outputs.default-python-version }}
124124
IS_RELEASE: "true"
125125
run: |
126-
# Get tags from calculation script
127-
eval "$(make get-container-tags)"
126+
# Get tags from Makefile target
127+
eval "$(make get-container-tags-env)"
128128
129129
# Create primary tags (latest, version)
130130
if [[ -n "$primary_tags" ]]; then
@@ -151,7 +151,7 @@ jobs:
151151
152152
prod-pypi:
153153
name: Publish to PyPI
154-
needs: get-config
154+
needs: config
155155
runs-on: ubuntu-latest
156156
environment: pypi
157157
permissions:
@@ -165,7 +165,7 @@ jobs:
165165
- name: Setup Python and UV
166166
uses: ./.github/actions/setup-uv-cached
167167
with:
168-
cache-key: prod-pypi-${{ needs.get-config.outputs.package-version }}
168+
cache-key: prod-pypi-${{ needs.config.outputs.package-version }}
169169
fail-on-cache-miss: false
170170

171171
- name: Build package
@@ -179,8 +179,11 @@ jobs:
179179

180180
prod-docs:
181181
name: Deploy Production Documentation
182-
needs: get-config
182+
needs: config
183183
runs-on: ubuntu-latest
184+
environment:
185+
name: github-pages
186+
url: ${{ steps.deployment.outputs.page_url }}
184187
permissions:
185188
contents: read
186189
pages: write
@@ -193,7 +196,7 @@ jobs:
193196
- name: Setup Python and UV
194197
uses: ./.github/actions/setup-uv-cached
195198
with:
196-
cache-key: prod-docs-${{ needs.get-config.outputs.package-version }}
199+
cache-key: prod-docs-${{ needs.config.outputs.package-version }}
197200
fail-on-cache-miss: false
198201

199202
- name: Build documentation
@@ -211,7 +214,7 @@ jobs:
211214

212215
github-assets:
213216
name: Upload GitHub Release Assets
214-
needs: [get-config, prod-containers, prod-pypi]
217+
needs: [config, prod-containers, prod-pypi]
215218
runs-on: ubuntu-latest
216219
permissions:
217220
contents: write
@@ -223,7 +226,7 @@ jobs:
223226
- name: Setup Python and UV
224227
uses: ./.github/actions/setup-uv-cached
225228
with:
226-
cache-key: prod-assets-${{ needs.get-config.outputs.package-version }}
229+
cache-key: prod-assets-${{ needs.config.outputs.package-version }}
227230
fail-on-cache-miss: false
228231

229232
- name: Build package
@@ -236,7 +239,7 @@ jobs:
236239
env:
237240
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238241
run: |
239-
VERSION="${{ needs.get-config.outputs.package-version }}"
242+
VERSION="${{ needs.config.outputs.package-version }}"
240243
RELEASE_TAG="v$VERSION"
241244
242245
# Upload wheel and source distribution

0 commit comments

Comments
 (0)