Skip to content

Commit

Permalink
chore(actions): 1.18.x release branch needs ci workflow definition. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Duftler committed Feb 12, 2020
1 parent b05520b commit 893e09d
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Deck CI

on:
pull_request:
push:
branches:
- release-*

env:
NODE_VERSION: 10.15.1

jobs:
ci:
name: Deck CI
needs: [test, build, packages]
runs-on: ubuntu-latest
steps:
- run: echo test, build, packages successful

test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Ensure package bumps are pure
id: purebump
run: app/scripts/modules/assert_package_bumps_standalone.sh

- uses: actions/setup-node@v1
if: steps.purebump.outputs.ispurebump != 'true'
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get yarn cache
if: steps.purebump.outputs.ispurebump != 'true'
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
if: steps.purebump.outputs.ispurebump != 'true'
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
if: steps.purebump.outputs.ispurebump != 'true'
run: yarn --frozen-lockfile

- name: Unit Tests
if: steps.purebump.outputs.ispurebump != 'true'
run: yarn test --single-run

build:
name: Production Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Ensure package bumps are pure
id: purebump
run: app/scripts/modules/assert_package_bumps_standalone.sh

- uses: actions/setup-node@v1
if: steps.purebump.outputs.ispurebump != 'true'
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get yarn cache
if: steps.purebump.outputs.ispurebump != 'true'
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
if: steps.purebump.outputs.ispurebump != 'true'
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
if: steps.purebump.outputs.ispurebump != 'true'
run: yarn --frozen-lockfile

- name: Yarn Build
if: steps.purebump.outputs.ispurebump != 'true'
run: yarn build

packages:
name: Build Packages
runs-on: ubuntu-latest

strategy:
matrix:
packages:
['core amazon docker titus', 'appengine azure cloudfoundry', 'ecs oracle', 'google huaweicloud kubernetes']

steps:
- uses: actions/checkout@v2

- name: Ensure package bumps are pure
id: purebump
run: app/scripts/modules/assert_package_bumps_standalone.sh

- uses: actions/setup-node@v1
if: steps.purebump.outputs.ispurebump != 'true'
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get yarn cache
if: steps.purebump.outputs.ispurebump != 'true'
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
if: steps.purebump.outputs.ispurebump != 'true'
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
if: steps.purebump.outputs.ispurebump != 'true'
run: yarn --frozen-lockfile

- name: Build NPM Packages
if: steps.purebump.outputs.ispurebump != 'true'
run: app/scripts/modules/build_modules.sh ${{ matrix.packages }}
30 changes: 30 additions & 0 deletions app/scripts/modules/build_modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

beginGroup() {
if [[ -n "$GITHUB_ACTIONS" ]] ; then
echo "::group::$*"
elif [[ -n "$TRAVIS" ]] ; then
echo "travis_fold:start:$*"
echo "::endgroup::"
fi
}

endGroup() {
if [[ -n "$GITHUB_ACTIONS" ]] ; then
echo "::endgroup::"
elif [[ -n "$TRAVIS" ]] ; then
echo "travis_fold:end:$*"
fi
}

cd "$(dirname "$0")" || exit $?
BUILD_ORDER=$(./build_order.sh $*)
[[ $? -eq 0 ]] || exit $?

for PACKAGE in $BUILD_ORDER ; do
beginGroup "$PACKAGE"
pushd "$PACKAGE" || exit $?
yarn lib || exit 255
endGroup "$PACKAGE"
popd || exit $?
done

0 comments on commit 893e09d

Please sign in to comment.