Skip to content

Commit

Permalink
ci: migrate test/lint to GH actions (#136)
Browse files Browse the repository at this point in the history
* ci: migrate test/lint to GH actions

* ci: fix typo

* ci: fix node version to 12

* ci: tweaks for codecov
  • Loading branch information
schottra authored Jan 11, 2021
1 parent 9076cce commit 0e18623
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 26 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,43 @@ name: Pull Request
on: pull_request

jobs:
unit_tests_with_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# We need history for codecov to work correctly
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '12'
- uses: bahmutov/npm-install@v1
- name: Run tests and generate coverage
run: make test_unit_codecov
- uses: codecov/codecov-action@v1
with:
files: .coverage/coverage-final.json
fail_ci_if_error: true

lint_project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12'
- uses: bahmutov/npm-install@v1
- name: Run linter
run: make lint

test_image_build:
name: Test build Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12'
- uses: bahmutov/npm-install@v1
- name: Build image
run: docker build .
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ update_boilerplate:
install: #installs dependencies
yarn

.PHONY: install_ci
install_ci: install
yarn add codecov

.PHONY: lint
lint: #lints the package for common code smells
yarn run lint
Expand Down Expand Up @@ -40,4 +36,4 @@ clean:
# submits the coverage to codecov.io
.PHONY: test_unit_codecov
test_unit_codecov:
yarn run test-coverage && yarn run codecov
yarn run test-coverage
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"build:prod": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' NODE_ENV=production webpack --config webpack.config.ts --mode=production",
"build": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' webpack --config webpack.config.ts --mode=development",
"clean": "rm -rf dist",
"codecov": "codecov -f .coverage/coverage-final.json",
"lint": "eslint . --ext .js,.ts,.tsx",
"lint-fix": "eslint . --ext .js,.ts,.tsx --fix",
"mockApi": "node ./mockApi",
Expand Down

0 comments on commit 0e18623

Please sign in to comment.