From 39219aed7f4a1c3e381e802e801a7917ce036ad6 Mon Sep 17 00:00:00 2001 From: Steffen Smolka Date: Sat, 19 Oct 2024 16:19:21 +0000 Subject: [PATCH] [NetKAT] Tweaks to Github Actions script and MODULE.bazel. PiperOrigin-RevId: 687636777 --- .github/workflows/{ci.yml => build.yml} | 25 +++++++++++++++++++++++-- MODULE.bazel | 1 - 2 files changed, 23 insertions(+), 3 deletions(-) rename .github/workflows/{ci.yml => build.yml} (63%) diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 63% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 4e42442..475a5b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,8 @@ on: schedule: # Run daily at midnight to ensure we catch regressions. - cron: "0 0 * * *" - # Manual + # Allow manual triggering of the workflow. + # https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow workflow_dispatch: jobs: @@ -26,16 +27,36 @@ jobs: path: "~/.cache/bazel" key: bazel-${{ hashFiles('MODULE.bazel', 'WORKSPACE.bazel', '.bazelrc') }}-${{ github.ref_name }} restore-keys: | - bazel-${{hashFiles('MODULE.bazel', 'WORKSPACE.bazel', '.bazelrc') }}-${{ github.ref_name }} bazel-${{hashFiles('MODULE.bazel', 'WORKSPACE.bazel', '.bazelrc') }} bazel- + - name: Save start time + uses: josStorer/get-current-time@v2 + id: start-time + with: + # Unix timestamp -- seconds since 1970. + format: X - name: Build run: bazel build --test_output=errors //... - name: Test run: bazel test --test_output=errors //... + - name: Save end time + uses: josStorer/get-current-time@v2 + id: end-time + with: + # Unix timestamp -- seconds since 1970. + format: X + + - name: Calculate build duration + run: | + START=${{ steps.start-time.outputs.formattedTime }} + END=${{ steps.end-time.outputs.formattedTime }} + DURATION=$(( $END - $START )) + echo "duration=$DURATION" | tee "$GITHUB_ENV" + + - name: Compress cache run: rm -rf $(bazel info repository_cache) diff --git a/MODULE.bazel b/MODULE.bazel index edb576a..cbc2709 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,7 +21,6 @@ module( compatibility_level = 1, ) -bazel_dep(name = "rules_cc", version = "0.0.13") bazel_dep(name = "rules_license", version = "1.0.0") bazel_dep(name = "protobuf", version = "28.2", repo_name = "com_google_protobuf") bazel_dep(name = "abseil-cpp", version = "20240116.2", repo_name = "com_google_absl")