Skip to content

Cookie Cutter Build Workflow Develop #1509

Cookie Cutter Build Workflow Develop

Cookie Cutter Build Workflow Develop #1509

Workflow file for this run

name: Cookie Cutter Build Workflow Develop
on:
push:
branches: [ develop, 'release/**']
pull_request:
branches: [ develop, 'release/**' ]
schedule:
- cron: '0 4 * * *'
jobs:
smoke:
name: Ubuntu Node 16 Smoke
runs-on: ubuntu-latest
outputs:
commit_message: ${{ steps.output_message.outputs.commit_message }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
with: # required for git log to access the correct commits
ref: ${{ github.event.pull_request.head.sha }}
- name: Get Commit Message
run: echo "COMMIT_MESSAGE=$(git log --format=oneline -n 1 ${{ github.event.after }})" >> $GITHUB_ENV
- name: Set Output Commit Message
id: output_message
env:
COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }}
run: |
echo "::set-output name=commit_message::$COMMIT_MESSAGE"
echo Commit Message: "$COMMIT_MESSAGE"
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: yarn build
- name: Yarn Lint
run: yarn lint
- name: Yarn Test
run: yarn test
- name: Yarn Audit
if: ${{ github.event_name == 'schedule' }}
run: yarn audit
# run: /bin/bash -c 'yarn audit; [[ $? -ge 8 ]] && exit 1 || exit 0'
master-audit:
name: Ubuntu Master Audit
runs-on: ubuntu-latest
outputs:
commit_message: ${{ steps.output_message.outputs.commit_message }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
with: # required for git log to access the correct commits
ref: master
- name: Setup Ubuntu Node 16
if: ${{ github.event_name == 'schedule' }}
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
if: ${{ github.event_name == 'schedule' }}
run: yarn set version 1.21.1
- name: Install Dependencies
if: ${{ github.event_name == 'schedule' }}
run: yarn install --frozen-lockfile
- name: Yarn Audit
if: ${{ github.event_name == 'schedule' }}
run: yarn audit
# test-ubuntu-node-12:
# name: Ubuntu Node 12 Test
# if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
# needs: smoke
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v2
# - name: Setup Ubuntu Node 12
# uses: actions/setup-node@v2-beta
# with:
# node-version: "12"
# - name: Install Yarn 1.21.1
# run: yarn set version 1.21.1
# - name: Install Dependencies
# run: yarn install --frozen-lockfile
# - name: Yarn Build
# run: yarn build
# - name: Yarn Test
# run: yarn test
test-macOS:
name: MacOS Node 16 Test
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
needs: [smoke, master-audit]
runs-on: macOS-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup MacOS Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: yarn build
- name: Yarn Test
run: yarn test
# # # # Disable until we can fix Windows Build Issue for for Node 12+
# test-windows:
# name: Windows Test
# if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
# needs: smoke
# runs-on: windows-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v2
# - name: Setup Windows Node 16
# uses: actions/setup-node@v2-beta
# with:
# node-version: "16"
# env:
# YARN_GPG: no # Windows build agent will hang without this
# - name: Install Yarn 1.21.1
# run: yarn set version 1.21.1
# - name: Install Dependencies
# run: yarn install --frozen-lockfile
# - name: Yarn Build
# run: yarn build
# - name: Yarn Test
# run: yarn test
# # # # Disable until we can fix Windows Build Issue for for Node 12+
# integration-azure:
# name: Azure Integration
# if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
# # needs: [test-ubuntu-node-12, test-windows]
# # needs: [test-macOS]
# needs: [smoke]
# runs-on: windows-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v2
# - name: Setup Windows Node 16
# uses: actions/setup-node@v2-beta
# with:
# node-version: "16"
# - name: Install Yarn 1.21.1
# run: yarn set version 1.21.1
# - name: Install Dependencies
# run: yarn install --frozen-lockfile
# - name: Run Integrate
# env:
# YARN_GPG: no # Windows build agent will hang without this
# NODE_TLS_REJECT_UNAUTHORIZED: "0"
# COSMOS_SECRET_KEY: "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
# AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;"
# AZURE_STORAGE_ACCESS_KEY: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
# AZURE_STORAGE_ACCOUNT: "devstoreaccount1"
# AZURE_STORAGE_URL: "http://127.0.0.1:10000/devstoreaccount1"
# RUNNING_IN_CI: "1"
# run: |
# PowerShell -c "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine"
# PowerShell -File packages/azure/start_emulators.ps1
# PowerShell -File packages/azure/run_integration_tests.ps1
integration-mssql:
name: MSSQL Integration
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
needs: [test-macOS]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: cd packages/core && yarn build && cd ../mssql && yarn build
- name: Yarn Integrate
run: cd packages/mssql && yarn integrate
integration-amqp:
name: AMQP Integration
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
needs: [test-macOS]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: cd packages/core && yarn build && cd ../amqp && yarn build
- name: Yarn Integrate
run: cd packages/amqp && yarn integrate
integration-kafka:
name: Kafka Integration
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
needs: [test-macOS]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: cd packages/core && yarn build && cd ../kafka && yarn build
- name: Yarn Integrate
run: cd packages/kafka && yarn integrate
integration-prometheus:
name: Prometheus Integration
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
needs: [test-macOS]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: cd packages/core && yarn build && cd ../prometheus && yarn build
- name: Yarn Integrate
run: cd packages/prometheus && yarn integrate
integration-s3:
name: S3 Integration
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
needs: [test-macOS]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: cd packages/core && yarn build && cd ../s3 && yarn build
- name: Yarn Integrate
run: cd packages/s3 && yarn integrate
integration-redis:
name: Redis Integration
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'pull_request' && ( github.base_ref == 'master' || contains(needs.smoke.outputs.commit_message, '[full ci]') || contains(needs.smoke.outputs.commit_message, '[full-ci]') ) ) }}
needs: [test-macOS]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Yarn Build
run: cd packages/core && yarn build && cd ../redis && yarn build
- name: Yarn Integrate
run: cd packages/redis && yarn integrate
publish-to-npm:
name: Publish to NPM
if: ${{ github.event_name == 'push' }}
needs: smoke
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Publish to NPM
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
yarn build && node ./.ci/deploy.js
publish-to-github-pages:
name: Publish to Github Pages
if: ${{ github.event_name == 'push' && contains(github.ref, 'master') }}
needs: smoke
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Ubuntu Node 16
uses: actions/setup-node@v2-beta
with:
node-version: "16"
- name: Install Yarn 1.21.1
run: yarn set version 1.21.1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Publish to Github Pages
env:
GH_NAME: sklose
GH_EMAIL: [email protected]
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "${GH_NAME}"
git config --global user.email "${GH_EMAIL}"
echo "machine github.com login ${GH_NAME} password ${GITHUB_TOKEN}" > ~/.netrc
cd docs/website && yarn install && GIT_USER="${GH_NAME}" yarn run publish-gh-pages