Skip to content

Commit

Permalink
chore: do not build the app xplatform all the time (#12817)
Browse files Browse the repository at this point in the history
It's good to run app builds to test if peoples' PRs work, but it's bad
if those app builds sporadically fail or take an hour even if they
succeed. Let's cut the number of times we do a full cross-platform app
build down by only doing the build if
- This is a tag
- This is edge
- This is release
- This is internal-release

In other cases, we'll only do the backend tests.
  • Loading branch information
sfoster1 authored Jun 2, 2023
1 parent 8e59cc2 commit ab15469
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
strategy:
matrix:
os: ['windows-2022', 'ubuntu-22.04', 'macos-11']

name: 'opentrons app backend unit tests and build'
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:
flags: app

# build the desktop app and deploy it
- if: github.event_name != 'pull_request'
- if: (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build'))
name: 'build app for ${{ matrix.os }}'
timeout-minutes: 60
env:
Expand All @@ -175,7 +176,7 @@ jobs:
run: |
make -C app-shell dist-${{ matrix.os }}
- if: github.event_name != 'pull_request'
- if: (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build'))
name: 'upload github artifact'
uses: actions/upload-artifact@v3
with:
Expand All @@ -193,6 +194,10 @@ jobs:
strategy:
matrix:
os: ['windows-2022', 'ubuntu-22.04', 'macos-latest']
exclude:
- os: format('macos-latest{0}', startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build') || null)
- os: format('windows-2022{0}', startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build') || null)

name: 'opentrons app backend unit tests and build for OT3'
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -239,7 +244,7 @@ jobs:
make setup-js
# build the app and deploy it
- if: github.event_name != 'pull_request'
- if: (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build'))
name: 'build app for ${{ matrix.os }}'
timeout-minutes: 60
env:
Expand All @@ -260,7 +265,7 @@ jobs:
run: |
make -C app-shell dist-${{ matrix.os }}
- if: github.event_name != 'pull_request'
- if: (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build'))
name: 'upload github artifact'
uses: actions/upload-artifact@v3
with:
Expand All @@ -272,7 +277,7 @@ jobs:
name: 'Deploy built app artifacts to S3'
runs-on: 'ubuntu-22.04'
needs: ['js-unit-test', 'build-app-test-backend']
if: github.event_name != 'pull_request'
if: (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build'))
steps:
- name: 'download run app builds'
uses: 'actions/download-artifact@v3'
Expand All @@ -293,7 +298,7 @@ jobs:
name: 'Deploy built OT3 app artifacts to S3'
runs-on: 'ubuntu-22.04'
needs: ['js-unit-test', 'build-app-ot3']
if: github.event_name != 'pull_request'
if: (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/edge') || startsWith(github.ref, 'refs/heads/internal-release') || startsWith(github.ref, 'refs/heads/release') || endsWith(github.ref, 'app-build'))
steps:
- name: 'download run app builds'
uses: 'actions/download-artifact@v3'
Expand Down

0 comments on commit ab15469

Please sign in to comment.