Skip to content

Commit

Permalink
chore: add start of github actions (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Mar 16, 2020
1 parent 56e1e16 commit c969884
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 2 deletions.
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

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

0 comments on commit c969884

Please sign in to comment.