Skip to content

Commit

Permalink
chore(IDX): don't store bazel-targets (#3851)
Browse files Browse the repository at this point in the history
This drops the `bazel-targets` which we previously used to keep a list
of built targets. The list was used in `build-determinism` to check
which targets were built by the `bazel-test-all` job, but since both
`build-ic` and `bazel-test-all` use the same diffing logic (`diff.sh`)
it's not necessary to pass the list around.

Also includes a necessary fix that ensure that even if there are no
targets, `build-ic.tar` is a valid tarball.

---------

Co-authored-by: IDX GitHub Automation <[email protected]>
  • Loading branch information
nmattia and sa-idx-admin authored Feb 7, 2025
1 parent f03f9ee commit b886b5f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
16 changes: 2 additions & 14 deletions .github/workflows-source/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ anchors:
uses: actions/setup-python@v5
with:
python-version: '3.12'
bazel-upload: &bazel-upload
name: Upload bazel-targets
uses: actions/upload-artifact@v4
with:
name: bazel-targets
retention-days: 14
if-no-files-found: error
path: |
bazel-targets
bazel-bep: &bazel-bep
name: Upload bazel-bep
# runs only if previous step succeeded or failed;
Expand Down Expand Up @@ -155,7 +146,6 @@ jobs:
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
- <<: *bazel-upload

bazel-build-all-config-check:
<<: *dind-large-setup
Expand Down Expand Up @@ -307,6 +297,8 @@ jobs:
name: Build Determinism
runs-on: ubuntu-latest
timeout-minutes: 30
# NOTE: this expects "build-ic" to have built the same set of targets
# as "bazel-test-all"
needs: [build-ic, bazel-test-all]
strategy:
matrix:
Expand All @@ -333,10 +325,6 @@ jobs:
SETUPOS_FLAG: "true"
steps:
- <<: *checkout
- name: Download bazel-targets [bazel-test-all]
uses: actions/download-artifact@v4
with:
name: bazel-targets
- name: Download build-ic.tar [build-ic]
uses: actions/download-artifact@v4
with:
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ jobs:
path: |
bazel-bep.pb.gpg
profile.json
- name: Upload bazel-targets
uses: actions/upload-artifact@v4
with:
name: bazel-targets
retention-days: 14
if-no-files-found: error
path: |
bazel-targets
bazel-build-all-config-check:
runs-on:
labels: dind-large
Expand Down Expand Up @@ -369,6 +361,8 @@ jobs:
name: Build Determinism
runs-on: ubuntu-latest
timeout-minutes: 30
# NOTE: this expects "build-ic" to have built the same set of targets
# as "bazel-test-all"
needs: [build-ic, bazel-test-all]
strategy:
matrix:
Expand Down Expand Up @@ -398,10 +392,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 256 || 0 }}
- name: Download bazel-targets [bazel-test-all]
uses: actions/download-artifact@v4
with:
name: bazel-targets
- name: Download build-ic.tar [build-ic]
uses: actions/download-artifact@v4
with:
Expand Down
3 changes: 0 additions & 3 deletions ci/bazel-scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ else
s3_upload="True"
fi

# pass info about bazel targets to bazel-targets file
echo "$BAZEL_TARGETS" >bazel-targets

# if bazel targets is empty we don't need to run any tests
if [ -z "${BAZEL_TARGETS:-}" ]; then
echo "No bazel targets to build"
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/run-build-ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ elif [[ "${RUN_ON_DIFF_ONLY:-}" == "true" ]]; then
exit 1
fi
echo "No changes that require building IC-OS, binaries or canisters."
touch build-ic.tar
tar -cf build-ic.tar -T /dev/null # create empty tar
exit 0
fi
ci/container/build-ic.sh "${ARGS[@]}"
Expand Down

0 comments on commit b886b5f

Please sign in to comment.