Skip to content

Commit

Permalink
CI: Stop building OCI images on each PR, to save resources
Browse files Browse the repository at this point in the history
The test suite itself is already pretty heavy. It is not much of a
problem, because GHA offers to build OCI images on demand interactively,
in order to be able to still ship images for testing, if we need it.
  • Loading branch information
amotl committed Sep 12, 2023
1 parent 463102a commit 52dcfc8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/oci-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
name: OCI for runtime

on:
pull_request: ~

# Build images when merging to `main` and when running a release.
push:
branches:
- 'main'
tags:
- '*.*.*'

# Build images on each pull request.
# Remark: Activate only when needed, it will eat a lot of resources. The alternative
# is to build manually / on-demand, by using the `workflow_dispatch` feature,
# available through the GHA web UI.
# pull_request: ~

# Produce a nightly image every day at 6 a.m. CEST.
schedule:
- cron: '0 4 * * *'
Expand Down Expand Up @@ -45,10 +54,11 @@ jobs:
ghcr.io/${{ env.IMAGE_NAME }}
# Generate OCI image tags based on the following events/attributes
tags: |
type=schedule,pattern=nightly
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=schedule,pattern=nightly
- name: Inspect metadata
run: |
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/oci-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
name: OCI for server

on:
pull_request: ~

# Build images when merging to `main` and when running a release.
push:
branches:
- 'main'
tags:
- '*.*.*'

# Build images on each pull request.
# Remark: Activate only when needed, it will eat a lot of resources. The alternative
# is to build manually / on-demand, by using the `workflow_dispatch` feature,
# available through the GHA web UI.
# pull_request: ~

# Produce a nightly image every day at 6 a.m. CEST.
schedule:
- cron: '0 4 * * *'
Expand Down Expand Up @@ -83,10 +92,11 @@ jobs:
ghcr.io/${{ env.IMAGE_NAME }}
# Generate OCI image tags based on the following events/attributes
tags: |
type=schedule,pattern=nightly
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=schedule,pattern=nightly
- name: Inspect metadata
run: |
Expand Down
6 changes: 3 additions & 3 deletions docs/backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

## Iteration +4
- UX: CLI shortcut for `ddl/drop.sql`
- CI: Do not build OCI images on _each_ PR in the long run, it costs too many
resources. Instead, document how to run OCI builds on demand on specific
branches, when it is needed to ship images for testing purposes.


## Done
Expand All @@ -34,3 +31,6 @@
- Add example `tracking_merlion.py`
- Integrate tutorial from `cratedb-examples`
- Add GHA recipe to build and ship OCI image
- CI: Do not build OCI images on _each_ PR in the long run, it costs too many
resources. Instead, document how to run OCI builds on demand on specific
branches, when it is needed to ship images for testing purposes.

0 comments on commit 52dcfc8

Please sign in to comment.