diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c98ac953 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Build + +on: + push: + paths: + - 'app/**' + - 'functions/**' + - 'shared/**' + pull_request: + paths: + - 'app/**' + - 'functions/**' + - 'shared/**' + +env: + CI: true + +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: + - 12.x + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache npm + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + + - name: Build Shared + run: (cd shared && npm install) + + - name: Build App + run: (cd app && npm install && npm run build:production) + + - name: Build Functions + run: (cd functions && npm install && npm run build) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bdc2345..b160bd74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,11 +43,5 @@ jobs: - name: Build Shared run: (cd shared && npm install) - - name: Build App - run: (cd app && npm install && npm run build:production) - - - name: Build Functions - run: (cd functions && npm install && npm run build) - - name: Validate Schemas run: (cd shared && npm run validate)