Skip to content

Lesson 12 - Add github actions #9

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check the source code
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install packages
run: yarn
- name: Test
run: yarn ci:jest
- name: Lint
run: yarn ci:lint-js
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest --watch",
"ci:jest": "jest --ci",
"ci:lint-js": "eslint --ext .js,.jsx ./",
"eject": "react-scripts eject",
"lint": "eslint './**/*.{js,jsx}' --fix",
"prepare": "husky install"
Expand Down
1 change: 1 addition & 0 deletions src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
// eslint-disable-next-line import/no-extraneous-dependencies
import "@testing-library/jest-dom";