Skip to content
Open
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
49 changes: 47 additions & 2 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,40 @@ jobs:
password: ${{ secrets.REGISTRY_PASSWORD }}
env:
OMNIBUS_BASE_DIR: /omnibus
OMNIBUS_GIT_CACHE_DIR: ${{ github.workspace }}/.omnibus-git-cache
BAZEL_CACHE_ROOT: ${{ github.workspace }}/.cache
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0

- name: Restore omnibus git cache (${{ matrix.arch }})
id: omnibus-git-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ env.OMNIBUS_GIT_CACHE_DIR }}
key: omnibus-git-${{ matrix.arch }}-${{ hashFiles('omnibus/**', 'release.json') }}
restore-keys: |
omnibus-git-${{ matrix.arch }}-

- name: Restore bazel caches (${{ matrix.arch }})
id: bazel-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
${{ env.BAZEL_CACHE_ROOT }}/bazelisk
${{ env.BAZEL_CACHE_ROOT }}/bazel/install
${{ env.BAZEL_CACHE_ROOT }}/bazel-repo
key: bazel-${{ matrix.arch }}-${{ hashFiles('.bazelversion', 'MODULE.bazel.lock', 'omnibus/config/software/datadog-agent-dependencies.rb') }}
restore-keys: |
bazel-${{ matrix.arch }}-

- name: Build DEB package with omnibus
env:
GITLAB_PACKAGE_REGISTRY_PYPI_SIMPLE_URL: ${{ vars.GITLAB_PACKAGE_REGISTRY_PYPI_SIMPLE_URL }}
Expand All @@ -104,8 +131,9 @@ jobs:
# DD 7.78 builds some dependencies through bazelisk from
# omnibus/config/software/datadog-agent-dependencies.rb. bazelisk aborts
# with "XDG_CACHE_HOME () must denote a directory in CI!" unless these
# point at real directories.
export XDG_CACHE_HOME="${GITHUB_WORKSPACE}/.cache"
# point at real directories. BAZEL_CACHE_ROOT is what the cache steps
# restore and save, so the two must stay in agreement.
export XDG_CACHE_HOME="${BAZEL_CACHE_ROOT}"
export BAZELISK_HOME="${XDG_CACHE_HOME}/bazelisk"
mkdir -p "${XDG_CACHE_HOME}/bazel" "${XDG_CACHE_HOME}/bazel-repo" "${BAZELISK_HOME}"
# .bazelrc:75 `try-import %workspace%/user.bazelrc` is the upstream-blessed
Expand Down Expand Up @@ -158,6 +186,23 @@ jobs:
--skip-sign \
--install-directory /opt/stackstate-agent

- name: Save omnibus git cache (${{ matrix.arch }})
if: github.event_name != 'pull_request' && steps.omnibus-git-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ env.OMNIBUS_GIT_CACHE_DIR }}
key: omnibus-git-${{ matrix.arch }}-${{ hashFiles('omnibus/**', 'release.json') }}

- name: Save bazel caches (${{ matrix.arch }})
if: github.event_name != 'pull_request' && steps.bazel-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
${{ env.BAZEL_CACHE_ROOT }}/bazelisk
${{ env.BAZEL_CACHE_ROOT }}/bazel/install
${{ env.BAZEL_CACHE_ROOT }}/bazel-repo
key: bazel-${{ matrix.arch }}-${{ hashFiles('.bazelversion', 'MODULE.bazel.lock', 'omnibus/config/software/datadog-agent-dependencies.rb') }}

- name: Collect package outputs
run: |
set -eo pipefail
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ omnibus/omnibus/
# User specific bazelrc file
/user.bazelrc

# Local omnibus git cache (OMNIBUS_GIT_CACHE_DIR), persisted by CI between builds
/.omnibus-git-cache/

# file generated by Cluster Agent image build
Dockerfiles/cluster-agent/nosys-seccomp

Expand Down
Loading