Skip to content
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

chore: migrate build from azure-pipelines to actions #1383

Merged
merged 16 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
106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- '**'

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
uses: actions/setup-node@v1
with:
node-version: 12

# This also runs a build as part of the postinstall bootstrap
- name: install and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn check-clean-workspace-after-install

# Note that this command *also* typechecks tests/tools,
# whereas the build only checks src files
- name: Typecheck all packages
run: yarn typecheck

- name: Check code formatting
run: yarn format-check

- name: Run linting
run: yarn lint

- name: Validate spelling
run: yarn check:spelling

- name: Run unit tests
run: yarn test
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:
yml: ./codecov.yml
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittest
name: codecov
Comment on lines +12 to +58
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question - did we want to split all of this up to give us more granular status checks?
I know that a bit of a pain point for people is just seeing "primary validation" failed, and then having to dig into the logs to see which step failed.

I.e. one job for each of:

  • type check
  • format check
  • lint
  • spelling
  • test + integration (+ coverage publish) test on latest node

Copy link
Member Author

@armano2 armano2 Feb 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you actually don't have to as actions are showing it in overview screen

example: https://github.com/armano2/test-eslint-monorpo/actions/runs/36409848

you can click on Check failure on line 1 in packages/a/src/index.js if file was modified it's going to show annotation within this file


unit_tests_on_other_node_versions:
name: Run unit tests on other Node.js versions
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x, 10.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# This also runs a build as part of the postinstall bootstrap
- name: install and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn check-clean-workspace-after-install

- name: Run unit tests
run: yarn test
env:
CI: true

publish_canary_version:
name: Publish the latest code as a canary version
runs-on: ubuntu-latest
needs: [primary_code_validation_and_tests, unit_tests_on_other_node_versions]
if: github.event_name == 'push' && github.ref == 'refs/head/master'
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

# This also runs a build as part of the postinstall bootstrap
- name: install 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 }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<p align="center">Monorepo for all the tooling which enables ESLint to support TypeScript</p>

<p align="center">
<a href="https://dev.azure.com/typescript-eslint/TypeScript%20ESLint/_build/latest?definitionId=1&branchName=master"><img src="https://img.shields.io/azure-devops/build/typescript-eslint/TypeScript%20ESLint/1/master.svg?label=%F0%9F%9A%80%20Azure%20Pipelines&style=flat-square" alt="Azure Pipelines"/></a>
<a href="https://opencollective.com/typescript-eslint" alt="Financial Contributors on Open Collective"><img src="https://opencollective.com/typescript-eslint/all/badge.svg?label=financial+contributors&style=flat-square" /></a>
<a href="https://github.com/typescript-eslint/typescript-eslint/actions"><img src="https://img.shields.io/github/workflow/status/typescript-eslint/typescript-eslint/CI?style=flat-square" alt="GitHub Workflow Status" /></a>
<a href="https://opencollective.com/typescript-eslint"><img src="https://opencollective.com/typescript-eslint/all/badge.svg?label=financial+contributors&style=flat-square" alt="Financial Contributors on Open Collective" /></a>
<a href="https://github.com/typescript-eslint/typescript-eslint/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/typescript-estree.svg?style=flat-square" alt="GitHub license" /></a>
<a href="https://www.npmjs.com/package/@typescript-eslint/typescript-estree"><img src="https://img.shields.io/npm/dm/@typescript-eslint/typescript-estree.svg?style=flat-square" alt="NPM Downloads" /></a>
<a href="https://codecov.io/gh/typescript-eslint/typescript-eslint"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/typescript-eslint/typescript-eslint.svg?style=flat-square"></a>
Expand Down