Skip to content

Commit

Permalink
Github Action for building and testing PRs (#924)
Browse files Browse the repository at this point in the history
* Build the client with Github Actions

* Syntax fix

* Add runs-on to setup step

* You can't checkout in one job and then run in another

* Install dependencies

* Avoid platform specific build-and-test for now

* Show yarn version

* Cache Yarn dependencies

* Use descriptive build step names

* Use yarn's built-in cache detection to use cached deps

* How did this even get here

* Formatting

* Remove stray comment

* Only run on push

Otherwise we will run the tests twice when a PR is opened -- once for the PR and once for the most recent branch.

* Remove unit tests from Travis workflow

* Run in series

* Update name of workflow
  • Loading branch information
Jonathan Cohen committed Dec 18, 2020
1 parent da57869 commit e11f106
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build_and_test.yml
@@ -0,0 +1,44 @@
name: Build and Test

on: push

jobs:
build-and-test:
name: Build and Test Web and Electron Apps
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v1

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 10

- name: Show Environment Info
run: yarn -v

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Check yarn cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --prefer-offline

- name: Build web app
run: yarn gulp build --platform=browser

- name: Test web app
run: yarn do scripts/test

- name: Build Electron app
run: yarn do src/electron/build
10 changes: 0 additions & 10 deletions .travis.yml
Expand Up @@ -50,16 +50,6 @@ stages:
# doing, we add a descriptive environment variable.
jobs:
include:
# Ideally, we would split this stage in some way, e.g. by component or by
# build/test commands, to make it clearer in the Travis UI exactly which
# command failed. However, since each stage incurs a significantly start-up
# cost, we combine test and build commands for all components into one fast
# stage.
- stage: build and unit test
script:
- yarn gulp build --platform=browser
- yarn do scripts/test

- stage: tag
script:
- RELEASE_NAME=daily-$(date -I)
Expand Down

0 comments on commit e11f106

Please sign in to comment.