Skip to content

chore: switch to github actions for ci #1745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 84 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
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.