Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/actions/clp-core-build-containers/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ inputs:
runs:
using: "composite"
steps:
- uses: "docker/setup-buildx-action@v3"
- uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2"

- if: "inputs.push_deps_image == 'true'"
uses: "docker/login-action@v3"
uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772"
with:
registry: "ghcr.io"
username: "${{github.actor}}"
Expand Down Expand Up @@ -52,13 +52,13 @@ runs:
fi

- id: "deps_image_meta"
uses: "docker/metadata-action@v5"
uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804"
with:
images: "${{steps.get_image_props.outputs.qualified_image_name}}"
tags: |
type=raw,value=${{steps.get_image_props.outputs.branch}}

- uses: "docker/build-push-action@v5"
- uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
with:
context: "${{inputs.docker_context}}"
file: "${{inputs.docker_file}}"
Expand All @@ -67,7 +67,7 @@ runs:
outputs: "${{steps.get_image_props.outputs.output}}"

- if: "inputs.push_deps_image == 'false'"
uses: "actions/upload-artifact@v4"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "${{steps.get_image_props.outputs.qualified_image_name}}"
path: "${{steps.get_image_props.outputs.image_path}}"
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/clp-execution-image-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ runs:
using: "composite"
steps:
- name: "Set up Docker Buildx"
uses: "docker/setup-buildx-action@v3"
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2"

- name: "Login to Image Registry"
uses: "docker/login-action@v3"
uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772"
with:
registry: "${{inputs.image_registry}}"
username: "${{inputs.image_registry_username}}"
Expand All @@ -47,14 +47,14 @@ runs:

- name: "Update Metadata"
id: "meta"
uses: "docker/metadata-action@v5"
uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804"
with:
images: "${{inputs.image_registry}}/${{steps.sanitization.outputs.REPOSITORY}}\
/clp-execution-x86-${{inputs.platform_id}}-${{inputs.platform_version_id}}"

- name: "Build and Push"
if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
with:
context: "./"
file: "./tools/docker-images/\
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/run-on-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
using: "composite"
steps:
- if: "inputs.use_published_image == 'false'"
uses: "actions/download-artifact@v4"
uses: "actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e"
with:
name: "${{inputs.image_name}}"
path: "/tmp"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/clp-core-build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ concurrency:

jobs:
build-macos:
name: "build-macos"
strategy:
matrix:
os:
Expand All @@ -52,7 +53,7 @@ jobs:
- false
runs-on: "${{matrix.os}}"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
# Fetch history so that the `clang-tidy-diff` task can compare against the main branch.
fetch-depth: 0
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/clp-core-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ concurrency: "${{github.workflow}}-${{github.ref}}"

jobs:
filter-relevant-changes:
name: "filter-relevant-changes"
runs-on: "ubuntu-latest"
outputs:
centos_stream_9_image_changed: "${{steps.filter.outputs.centos_stream_9_image}}"
ubuntu_jammy_image_changed: "${{steps.filter.outputs.ubuntu_jammy_image}}"
clp_changed: "${{steps.filter.outputs.clp}}"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use a variable instead of repeating the hash in multiple places in this file? (I haven't tried myself.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently they can be configured as variables through repository settings on github if we want to look into that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a link to the docs about it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you test if it works using your fork?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing repository variables directly to the uses: statement (i.e: uses: "actions/checkout@${{ CHECKOUT_VERSION }}") doesn't work, since dynamic values aren't allowed. https://github.com/orgs/community/discussions/25246

There might be some kind of workaround but I'm not sure.

with:
submodules: "recursive"

Expand All @@ -52,7 +53,7 @@ jobs:
shell: "bash"

- name: "Filter relevant changes"
uses: "dorny/paths-filter@v3"
uses: "dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36"
id: "filter"
with:
# Consider changes between the current commit and `main`
Expand Down Expand Up @@ -91,11 +92,12 @@ jobs:
- "tools/scripts/deps-download/**"

centos-stream-9-deps-image:
name: "centos-stream-9-deps-image"
if: "needs.filter-relevant-changes.outputs.centos_stream_9_image_changed == 'true'"
needs: "filter-relevant-changes"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

Expand All @@ -116,11 +118,12 @@ jobs:
token: "${{secrets.GITHUB_TOKEN}}"

ubuntu-jammy-deps-image:
name: "ubuntu-jammy-deps-image"
if: "needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'true'"
needs: "filter-relevant-changes"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

Expand Down Expand Up @@ -155,7 +158,7 @@ jobs:
continue-on-error: true
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

Expand Down Expand Up @@ -200,7 +203,7 @@ jobs:
continue-on-error: true
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

Expand Down Expand Up @@ -234,13 +237,14 @@ jobs:
shell: "bash"

- if: "matrix.upload_binaries == true"
uses: "actions/upload-artifact@v4"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"
path: "${{steps.copy_binaries.outputs.output_dir}}"
retention-days: 1

ubuntu-jammy-binaries-image:
name: "ubuntu-jammy-binaries-image"
# Run if the ancestor jobs were successful/skipped and building clp was successful.
if: "!cancelled() && !failure() && needs.ubuntu-jammy-binaries.result == 'success'"
needs: "ubuntu-jammy-binaries"
Expand All @@ -249,15 +253,15 @@ jobs:
OS_NAME: "ubuntu-jammy"
TMP_OUTPUT_DIR: "/tmp"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"

- uses: "actions/download-artifact@v4"
- uses: "actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e"
with:
name: "${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"
path: "${{env.TMP_OUTPUT_DIR}}/${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"
Expand All @@ -269,7 +273,7 @@ jobs:
tar xf clp.tar
rm clp.tar

- uses: "docker/login-action@v3"
- uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772"
with:
registry: "ghcr.io"
username: "${{github.actor}}"
Expand All @@ -285,7 +289,7 @@ jobs:
shell: "bash"

- id: "core_image_meta"
uses: "docker/metadata-action@v5"
uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804"
with:
images: >-
ghcr.io/${{steps.sanitize_repo_name.outputs.repository}}/clp-core-x86-${{env.OS_NAME}}
Expand All @@ -294,7 +298,7 @@ jobs:
# Only publish the image if this workflow was triggered by a push to `main`.
# NOTE: We run the rest of the job to test that the binaries were uploaded correctly.
- if: "github.event_name == 'push' && github.ref == 'refs/heads/main'"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
with:
context: "${{env.TMP_OUTPUT_DIR}}/${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"
file: "components/core/tools/docker-images/clp-core-${{env.OS_NAME}}/Dockerfile"
Expand All @@ -303,6 +307,7 @@ jobs:
labels: "${{steps.core_image_meta.outputs.labels}}"

ubuntu-jammy-lint:
name: "ubuntu-jammy-lint"
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
if: >-
success()
Expand All @@ -312,7 +317,7 @@ jobs:
- "ubuntu-jammy-deps-image"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
# Fetch history so that the `clang-tidy-diff` task can compare against the main branch.
fetch-depth: 0
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/clp-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ concurrency:

jobs:
build:
name: "build"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
runs-on: "${{matrix.os}}"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

- uses: "actions/setup-python@v5"
- uses: "actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38"
with:
python-version: "3.10"

Expand All @@ -45,7 +46,7 @@ jobs:
contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
&& ('refs/heads/main' == github.ref || startsWith(github.ref, 'refs/tags/v'))
&& 'ubuntu-latest' == matrix.os
uses: "actions/upload-artifact@v4"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "docs-html"
path: "build/docs/html"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/clp-execution-image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ concurrency:

jobs:
filter-relevant-changes:
name: "filter-relevant-changes"
runs-on: "ubuntu-latest"
outputs:
ubuntu_jammy_image_changed: "${{steps.filter.outputs.ubuntu_jammy_image}}"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

Expand All @@ -36,7 +37,7 @@ jobs:
shell: "bash"

- name: "Filter relevant changes"
uses: "dorny/paths-filter@v3"
uses: "dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36"
id: "filter"
with:
base: "main"
Expand All @@ -46,12 +47,13 @@ jobs:
- ".github/workflows/clp-execution-image-build.yaml"
- "tools/docker-images/clp-execution-base-ubuntu-jammy/**/*"

ubuntu_jammy_execution_image:
ubuntu-jammy-execution-image:
name: "ubuntu-jammy-execution-image"
if: "'true' == needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed"
needs: "filter-relevant-changes"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/clp-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ concurrency:

jobs:
lint-check:
name: "lint-check"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
runs-on: "${{matrix.os}}"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
with:
submodules: "recursive"

- uses: "actions/setup-python@v5"
- uses: "actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38"
with:
python-version: "3.11"

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/clp-pr-title-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ concurrency:

jobs:
conventional-commits:
name: "conventional-commits"
permissions:
# For amannn/action-semantic-pull-request
pull-requests: "read"
runs-on: "ubuntu-latest"
steps:
- uses: "amannn/action-semantic-pull-request@v5"
- uses: "amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017"
env:
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"