From 8d2d0e3978e7ff79522f5effb45820adf56256ec Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 5 Jun 2022 21:17:17 -0700 Subject: [PATCH 1/3] run the do_not_run_on_main tests on the versioned branch --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b4f2bfb8f..4dba633896 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,31 @@ jobs: # bazel generated node_modules run: bazelisk test //... + TestForMergeToVersioned: + # This runs just the tests that are specified not to run on main + if: github.ref == 'refs/heads/versioned' + name: Tests (for merging into versioned branch) + runs-on: ubuntu-latest + needs: Test + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: '16' + - name: Restore bazel cache + uses: actions/cache@v3.0.3 + env: + cache-name: bazel-cache + with: + path: | + ~/.cache/bazelisk + ~/.cache/bazel + key: ${{ runner.os }}-${{ env.cache-name }} + - name: All tests + run: bazelisk test //... --test_tag_filters=do_not_run_on_main + deployment: if: github.event_name == 'push' && github.ref == 'refs/heads/versioned' runs-on: ubuntu-latest From 41268c4210ed7d968972b8b75e0fd80fae135717 Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 5 Jun 2022 21:35:18 -0700 Subject: [PATCH 2/3] Try to fix, yet again, the process of syncing versioned with main Then, also see if we can skip using the dependabot automerge script entirely. --- .github/scripts/copy_to_versioned.sh | 14 ++++++++++++++ .github/workflows/ci.yml | 13 +++---------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .github/scripts/copy_to_versioned.sh diff --git a/.github/scripts/copy_to_versioned.sh b/.github/scripts/copy_to_versioned.sh new file mode 100644 index 0000000000..3187a2aa0e --- /dev/null +++ b/.github/scripts/copy_to_versioned.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +echo "Open PR to versioned branch (or not, if it was already there)" +echo "" +echo "Skipping failure here too, becuase we don't actually care" +echo "if the PR is already there." +gh pr create -f --head --main --base versioned || true + +echo "This ensures we have our commits pushed. We could be up to date" +echo "already. But it doesn't really matter." +git push || true + +echo "Setting PR to merge automatically..." +gh pr merge versioned --auto diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dba633896..c0b35df695 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,16 +15,13 @@ jobs: automerge: name: Auto-merge if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' - needs: Test runs-on: ubuntu-latest permissions: pull-requests: write contents: write steps: - name: 'Merge (if dependabot)' - uses: fastify/github-action-merge-dependabot@v3 - with: - github-token: ${{secrets.GITHUB_TOKEN}} + run: gh pr merge versioned --auto Test: @@ -122,10 +119,6 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Open PR to 'versioned' branch - run: gh pr create -f --head main --base versioned - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Set PR to merge automatically - run: gh pr merge versioned --auto + - run: ./.github/scripts/copy_to_versioned.sh + shell: bash \ No newline at end of file From e03eec5b0f9970701b0096579367b2209f2fa7be Mon Sep 17 00:00:00 2001 From: zemnmez Date: Sun, 5 Jun 2022 21:36:39 -0700 Subject: [PATCH 3/3] Swap the executable bit on our copy_to_versioned.sh --- .github/scripts/copy_to_versioned.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/scripts/copy_to_versioned.sh diff --git a/.github/scripts/copy_to_versioned.sh b/.github/scripts/copy_to_versioned.sh old mode 100644 new mode 100755