Skip to content

Commit

Permalink
Merge pull request #320 from Zemnmez/version-pipelining
Browse files Browse the repository at this point in the history
run the do_not_run_on_main tests on the versioned branch
  • Loading branch information
Zemnmez authored Jun 6, 2022
2 parents 5154c1c + f29c484 commit 1fdce4a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
14 changes: 14 additions & 0 deletions .github/scripts/copy_to_versioned.sh
Original file line number Diff line number Diff line change
@@ -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
38 changes: 28 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -57,6 +54,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
Expand Down Expand Up @@ -97,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

0 comments on commit 1fdce4a

Please sign in to comment.