From c270570f77c77bd416037d23d78b43f2418e0181 Mon Sep 17 00:00:00 2001 From: Jonathan Yu Date: Fri, 12 Mar 2021 09:48:39 -0800 Subject: [PATCH] chore: run builds on pull requests (#2866) * Run builds when changes are pushed to the main branch, or for pull requests opened against the main branch. This is a subtle change in behavior because, previously, builds would've run on pushes to any branch, regardless if a pull request is open yet. * Update to GitHub actions/checkout v2, which performs a shallow clone by default, and should speed up the build. Closes: #2559 --- .github/workflows/ci.yaml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index de514b57..c861a808 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,12 +1,18 @@ name: ci -on: [push] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Run ./ci/steps/fmt.sh uses: ./ci/images/debian10 with: @@ -15,7 +21,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Run ./ci/steps/lint.sh uses: ./ci/images/debian10 with: @@ -28,7 +34,7 @@ jobs: PASSWORD: e45432jklfdsab CODE_SERVER_ADDRESS: http://localhost:8080 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Download release packages uses: actions/download-artifact@v2 with: @@ -55,7 +61,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Run ./ci/steps/release.sh uses: ./ci/images/debian10 with: @@ -70,7 +76,7 @@ jobs: needs: release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Download npm package uses: actions/download-artifact@v2 with: @@ -90,7 +96,7 @@ jobs: needs: release runs-on: ubuntu-arm64-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Download npm package uses: actions/download-artifact@v2 with: @@ -111,8 +117,10 @@ jobs: macos-amd64: needs: release runs-on: macos-latest + # This job requires secrets, so can only run on the default branch + if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Download npm package uses: actions/download-artifact@v2 with: @@ -133,7 +141,7 @@ jobs: runs-on: ubuntu-latest needs: linux-amd64 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Download release package uses: actions/download-artifact@v2 with: @@ -153,7 +161,7 @@ jobs: runs-on: ubuntu-arm64-latest needs: linux-arm64 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Download release package uses: actions/download-artifact@v2 with: