Skip to content

Commit 38da960

Browse files
author
Zach Price
committed
feat: Build and publish Helm chart in CI
1 parent 3e44504 commit 38da960

26 files changed

+1093
-425
lines changed

.github/actions/build-container/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ runs:
2626
cache-to: type=gha,mode=max
2727
context: .
2828
file: ${{ inputs.dockerfile }}
29-
push: ${{ ! github.event.pull_request.head.repo.fork }}
29+
push: true
3030
sbom: true
3131
tags: ${{ steps.metadata.outputs.tags }}
3232
labels: ${{ steps.metadata.outputs.labels }}
3333
- name: Attest to REF image
3434
uses: actions/attest-build-provenance@v2
35-
if: ${{ ! github.event.pull_request.head.repo.fork }}
3635
with:
3736
subject-name: ghcr.io/${{ github.repository_owner }}/${{ inputs.container-name }}
3837
subject-digest: ${{ steps.push.outputs.digest }}
Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
name: Integration tests
1+
# name: Integration tests
22

3-
on:
4-
# Allow manual triggering of this workflow
5-
workflow_dispatch:
6-
# Run on each push to main and tagged version
7-
push:
8-
branches: [main]
9-
tags: ['v*']
10-
# Runs every day at 2:15am (UTC) (~ midday in AEST)
11-
schedule:
12-
- cron: '2 15 * * *'
3+
# on:
4+
# # Allow manual triggering of this workflow
5+
# workflow_dispatch:
6+
# # Run on each push to main and tagged version
7+
# push:
8+
# branches: [main]
9+
# tags: ['v*']
10+
# # Runs every day at 2:15am (UTC) (~ midday in AEST)
11+
# schedule:
12+
# - cron: '2 15 * * *'
1313

14-
jobs:
15-
tests-slow:
16-
if: github.repository == 'Climate-REF/climate-ref'
17-
env:
18-
REF_TEST_OUTPUT: "test-outputs"
19-
PYTEST_ADDOPTS: "--slow"
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
python-version: [ "3.11", "3.13" ]
24-
runs-on: "self-hosted"
25-
defaults:
26-
run:
27-
shell: bash
28-
steps:
29-
- name: Check out repository
30-
uses: actions/checkout@v4
31-
- uses: ./.github/actions/setup
32-
with:
33-
python-version: ${{ matrix.python-version }}
34-
- name: Run tests
35-
run: |
36-
make virtual-environment
37-
make fetch-test-data
38-
uv run ref datasets fetch-data --registry ilamb --symlink
39-
uv run ref datasets fetch-data --registry iomb --symlink
40-
uv run ref datasets fetch-data --registry esmvaltool --symlink
41-
uv run ref providers create-env
42-
uv run pytest packages tests --slow --no-docker -r a -v
43-
# Upload the scratch and executions directories as artifacts
44-
- name: Upload scratch artifacts
45-
uses: actions/upload-artifact@v4
46-
if: always()
47-
with:
48-
name: integration-output-${{ matrix.python-version }}
49-
path: ${{ env.REF_TEST_OUTPUT }}
50-
retention-days: 7
14+
# jobs:
15+
# tests-slow:
16+
# if: github.repository == 'Climate-REF/climate-ref'
17+
# env:
18+
# REF_TEST_OUTPUT: "test-outputs"
19+
# PYTEST_ADDOPTS: "--slow"
20+
# strategy:
21+
# fail-fast: false
22+
# matrix:
23+
# python-version: [ "3.11", "3.13" ]
24+
# runs-on: "self-hosted"
25+
# defaults:
26+
# run:
27+
# shell: bash
28+
# steps:
29+
# - name: Check out repository
30+
# uses: actions/checkout@v4
31+
# - uses: ./.github/actions/setup
32+
# with:
33+
# python-version: ${{ matrix.python-version }}
34+
# - name: Run tests
35+
# run: |
36+
# make virtual-environment
37+
# make fetch-test-data
38+
# uv run ref datasets fetch-data --registry ilamb --symlink
39+
# uv run ref datasets fetch-data --registry iomb --symlink
40+
# uv run ref datasets fetch-data --registry esmvaltool --symlink
41+
# uv run ref providers create-env
42+
# uv run pytest packages tests --slow --no-docker -r a -v
43+
# # Upload the scratch and executions directories as artifacts
44+
# - name: Upload scratch artifacts
45+
# uses: actions/upload-artifact@v4
46+
# if: always()
47+
# with:
48+
# name: integration-output-${{ matrix.python-version }}
49+
# path: ${{ env.REF_TEST_OUTPUT }}
50+
# retention-days: 7

.github/workflows/ci.yaml

Lines changed: 137 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,144 @@
1-
name: CI
1+
# name: CI
22

3-
on:
4-
pull_request:
5-
push:
6-
branches: [main]
7-
tags: ['v*']
3+
# on:
4+
# pull_request:
5+
# push:
6+
# branches: [main]
7+
# tags: ['v*']
88

9-
jobs:
10-
pre-commit:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Check out repository
14-
uses: actions/checkout@v4
15-
- uses: ./.github/actions/setup
16-
# Verifies that Ruff and mypy checks are passing
17-
- name: pre-commit
18-
run: make pre-commit
9+
# jobs:
10+
# pre-commit:
11+
# runs-on: ubuntu-latest
12+
# steps:
13+
# - name: Check out repository
14+
# uses: actions/checkout@v4
15+
# - uses: ./.github/actions/setup
16+
# # Verifies that Ruff and mypy checks are passing
17+
# - name: pre-commit
18+
# run: make pre-commit
1919

20-
tests:
21-
env:
22-
REF_TEST_OUTPUT: "test-outputs"
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
os: [ "ubuntu-latest" ]
27-
python-version: [ "3.13" ]
28-
runs-on: "${{ matrix.os }}"
29-
defaults:
30-
run:
31-
# This might be needed for Windows and doesn't seem to affect unix-based systems
32-
# so we include it. If you have better proof of whether this is needed or not,
33-
# feel free to update.
34-
shell: bash
35-
steps:
36-
- name: Check out repository
37-
uses: actions/checkout@v4
38-
- uses: ./.github/actions/setup
39-
with:
40-
python-version: ${{ matrix.python-version }}
41-
- name: Run tests
42-
run: |
43-
make fetch-test-data
44-
make test
45-
uv run coverage xml
46-
- name: Upload coverage reports to Codecov with GitHub Action
47-
uses: codecov/codecov-action@v5
48-
env:
49-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
50-
- name: Upload scratch artifacts
51-
uses: actions/upload-artifact@v4
52-
if: always()
53-
with:
54-
name: test-output-${{ matrix.python-version }}
55-
path: ${{ env.REF_TEST_OUTPUT }}
56-
retention-days: 7
20+
# tests:
21+
# env:
22+
# REF_TEST_OUTPUT: "test-outputs"
23+
# strategy:
24+
# fail-fast: false
25+
# matrix:
26+
# os: [ "ubuntu-latest" ]
27+
# python-version: [ "3.13" ]
28+
# runs-on: "${{ matrix.os }}"
29+
# defaults:
30+
# run:
31+
# # This might be needed for Windows and doesn't seem to affect unix-based systems
32+
# # so we include it. If you have better proof of whether this is needed or not,
33+
# # feel free to update.
34+
# shell: bash
35+
# steps:
36+
# - name: Check out repository
37+
# uses: actions/checkout@v4
38+
# - uses: ./.github/actions/setup
39+
# with:
40+
# python-version: ${{ matrix.python-version }}
41+
# - name: Run tests
42+
# run: |
43+
# make fetch-test-data
44+
# make test
45+
# uv run coverage xml
46+
# - name: Upload coverage reports to Codecov with GitHub Action
47+
# uses: codecov/codecov-action@v5
48+
# env:
49+
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
50+
# - name: Upload scratch artifacts
51+
# uses: actions/upload-artifact@v4
52+
# if: always()
53+
# with:
54+
# name: test-output-${{ matrix.python-version }}
55+
# path: ${{ env.REF_TEST_OUTPUT }}
56+
# retention-days: 7
5757

58-
imports-without-extras:
59-
strategy:
60-
fail-fast: false
61-
matrix:
62-
os: [ "ubuntu-latest" ]
63-
python-version: [ "3.11", "3.13" ]
64-
runs-on: "${{ matrix.os }}"
65-
steps:
66-
- name: Check out repository
67-
uses: actions/checkout@v4
68-
- uses: ./.github/actions/setup
69-
with:
70-
python-version: ${{ matrix.python-version }}
71-
- name: Check importable without extras
72-
run: |
73-
uv run --isolated --with-editable packages/climate-ref --with typer --no-project scripts/test-install.py climate_ref
74-
uv run --isolated --with-editable packages/climate-ref-core --with typer --no-project scripts/test-install.py climate_ref_core
75-
uv run --isolated --with-editable packages/climate-ref-celery --with typer --no-project scripts/test-install.py climate_ref_celery
76-
uv run --isolated --with-editable packages/climate-ref-ilamb --with typer --no-project scripts/test-install.py climate_ref_ilamb
77-
uv run --isolated --with-editable packages/climate-ref-esmvaltool --with typer --no-project scripts/test-install.py climate_ref_esmvaltool
78-
uv run --isolated --with-editable packages/climate-ref-pmp --with typer --no-project scripts/test-install.py climate_ref_pmp
58+
# imports-without-extras:
59+
# strategy:
60+
# fail-fast: false
61+
# matrix:
62+
# os: [ "ubuntu-latest" ]
63+
# python-version: [ "3.11", "3.13" ]
64+
# runs-on: "${{ matrix.os }}"
65+
# steps:
66+
# - name: Check out repository
67+
# uses: actions/checkout@v4
68+
# - uses: ./.github/actions/setup
69+
# with:
70+
# python-version: ${{ matrix.python-version }}
71+
# - name: Check importable without extras
72+
# run: |
73+
# uv run --isolated --with-editable packages/climate-ref --with typer --no-project scripts/test-install.py climate_ref
74+
# uv run --isolated --with-editable packages/climate-ref-core --with typer --no-project scripts/test-install.py climate_ref_core
75+
# uv run --isolated --with-editable packages/climate-ref-celery --with typer --no-project scripts/test-install.py climate_ref_celery
76+
# uv run --isolated --with-editable packages/climate-ref-ilamb --with typer --no-project scripts/test-install.py climate_ref_ilamb
77+
# uv run --isolated --with-editable packages/climate-ref-esmvaltool --with typer --no-project scripts/test-install.py climate_ref_esmvaltool
78+
# uv run --isolated --with-editable packages/climate-ref-pmp --with typer --no-project scripts/test-install.py climate_ref_pmp
7979

80-
check-build:
81-
runs-on: ubuntu-latest
82-
steps:
83-
- name: Check out repository
84-
uses: actions/checkout@v4
85-
- uses: ./.github/actions/setup
86-
- name: Check build
87-
run: |
88-
make build
89-
tar -tvf dist/climate_ref-*.tar.gz --wildcards '*climate_ref/py.typed' '*/LICENCE' '*/NOTICE'
90-
tar -tvf dist/climate_ref_core-*.tar.gz --wildcards '*climate_ref_core/py.typed' '*/LICENCE' '*/NOTICE'
91-
- name: Check installable
92-
run: |
93-
uv pip install dist/*.whl
94-
uv pip freeze
95-
uv run --no-sync python -c "import climate_ref; print(climate_ref.__version__)"
96-
uv run --no-sync ref config list
80+
# check-build:
81+
# runs-on: ubuntu-latest
82+
# steps:
83+
# - name: Check out repository
84+
# uses: actions/checkout@v4
85+
# - uses: ./.github/actions/setup
86+
# - name: Check build
87+
# run: |
88+
# make build
89+
# tar -tvf dist/climate_ref-*.tar.gz --wildcards '*climate_ref/py.typed' '*/LICENCE' '*/NOTICE'
90+
# tar -tvf dist/climate_ref_core-*.tar.gz --wildcards '*climate_ref_core/py.typed' '*/LICENCE' '*/NOTICE'
91+
# - name: Check installable
92+
# run: |
93+
# uv pip install dist/*.whl
94+
# uv pip freeze
95+
# uv run --no-sync python -c "import climate_ref; print(climate_ref.__version__)"
96+
# uv run --no-sync ref config list
9797

98-
# Check if a changelog message was added to the PR
99-
# Only runs on pull requests
100-
check-for-changelog:
101-
runs-on: ubuntu-latest
102-
if: github.event.pull_request
103-
steps:
104-
- name: Check out repository
105-
uses: actions/checkout@v4
106-
- uses: ./.github/actions/setup
107-
- name: Get all changelog files
108-
id: changed-changelog-files
109-
uses: tj-actions/changed-files@v45
110-
with:
111-
# Avoid using single or double quotes for multiline patterns
112-
files: |
113-
changelog/*.md
114-
- name: Print out the changed files
115-
if: steps.changed-files-specific.outputs.any_changed == 'true'
116-
env:
117-
ALL_CHANGED_FILES: ${{ steps.changed-changelog-files.outputs.all_changed_files }}
118-
run: |
119-
make changelog-draft
120-
- name: Fail if no changelog message is present
121-
if: steps.changed-changelog-files.outputs.any_changed == 'false'
122-
run: |
123-
echo "No changelog present."
124-
exit 1
98+
# # Check if a changelog message was added to the PR
99+
# # Only runs on pull requests
100+
# check-for-changelog:
101+
# runs-on: ubuntu-latest
102+
# if: github.event.pull_request
103+
# steps:
104+
# - name: Check out repository
105+
# uses: actions/checkout@v4
106+
# - uses: ./.github/actions/setup
107+
# - name: Get all changelog files
108+
# id: changed-changelog-files
109+
# uses: tj-actions/changed-files@v45
110+
# with:
111+
# # Avoid using single or double quotes for multiline patterns
112+
# files: |
113+
# changelog/*.md
114+
# - name: Print out the changed files
115+
# if: steps.changed-files-specific.outputs.any_changed == 'true'
116+
# env:
117+
# ALL_CHANGED_FILES: ${{ steps.changed-changelog-files.outputs.all_changed_files }}
118+
# run: |
119+
# make changelog-draft
120+
# - name: Fail if no changelog message is present
121+
# if: steps.changed-changelog-files.outputs.any_changed == 'false'
122+
# run: |
123+
# echo "No changelog present."
124+
# exit 1
125125

126-
smoke-test:
127-
runs-on: ubuntu-latest
128-
steps:
129-
- name: Check out repository
130-
uses: actions/checkout@v4
131-
- name: Set up Docker Buildx
132-
uses: docker/setup-buildx-action@v3
133-
- name: Set up Docker Compose
134-
uses: docker/setup-compose-action@v1
135-
- uses: ./.github/actions/setup
136-
with:
137-
python-version: ${{ matrix.python-version }}
138-
- name: Run smoke test
139-
run: |
140-
bash scripts/smoke-test.sh
141-
- name: Cleanup
142-
if: always()
143-
run: |
144-
docker compose down -v
126+
# smoke-test:
127+
# runs-on: ubuntu-latest
128+
# steps:
129+
# - name: Check out repository
130+
# uses: actions/checkout@v4
131+
# - name: Set up Docker Buildx
132+
# uses: docker/setup-buildx-action@v3
133+
# - name: Set up Docker Compose
134+
# uses: docker/setup-compose-action@v1
135+
# - uses: ./.github/actions/setup
136+
# with:
137+
# python-version: ${{ matrix.python-version }}
138+
# - name: Run smoke test
139+
# run: |
140+
# bash scripts/smoke-test.sh
141+
# - name: Cleanup
142+
# if: always()
143+
# run: |
144+
# docker compose down -v

0 commit comments

Comments
 (0)