Skip to content

Commit

Permalink
chore: switch to github actions for ci (#1745)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Mar 16, 2020
1 parent c969884 commit d121838
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 121 deletions.
101 changes: 84 additions & 17 deletions .github/workflows/ci.yml
Expand Up @@ -8,24 +8,39 @@ on:
branches:
- '**'

env:
PRIMARY_NODE_VERSION: 12

jobs:
primary_code_validation_and_tests:
name: Primary code validation and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: 12
node-version: ${{ env.PRIMARY_NODE_VERSION }}

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

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# This also runs a build as part of the postinstall bootstrap
- name: install and build
- name: Install dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn check-clean-workspace-after-install
# Note that this command *also* typechecks tests/tools,
# Note that this command *also* type checks tests/tools,
# whereas the build only checks src files
- name: Typecheck all packages
run: yarn typecheck
Expand All @@ -44,11 +59,6 @@ jobs:
env:
CI: true

- name: Run integrations tests
run: yarn integration-tests
env:
CI: true

- name: Publish code coverage report
uses: codecov/codecov-action@v1
with:
Expand All @@ -57,6 +67,39 @@ jobs:
flags: unittest
name: codecov

integration_tests:
name: Run integration tests on primary Node.js version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}

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

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# This also runs a build as part of the postinstall bootstrap
- name: Install dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn check-clean-workspace-after-install
- name: Run integrations tests
run: yarn integration-tests
env:
CI: true

unit_tests_on_other_node_versions:
name: Run unit tests on other Node.js versions
runs-on: ubuntu-latest
Expand All @@ -70,8 +113,20 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

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

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# This also runs a build as part of the postinstall bootstrap
- name: install and build
- name: Install dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn check-clean-workspace-after-install
Expand All @@ -88,19 +143,31 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/head/master'
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: 12
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: https://registry.npmjs.org/

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

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# This also runs a build as part of the postinstall bootstrap
- name: install and build
- name: Install dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn check-clean-workspace-after-install
# - name: Publish all packages to npm
# run: npx lerna publish --canary --exact --force-publish --yes
# env:
# NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- name: Publish all packages to npm
run: npx lerna publish --canary --exact --force-publish --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
104 changes: 0 additions & 104 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit d121838

Please sign in to comment.