mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-02 03:00:32 -04:00
Setup CI to run linting / typechecking / unit testing with Github Actions
This commit is contained in:
38
.github/workflows/PR-CI.yml
vendored
Normal file
38
.github/workflows/PR-CI.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: TheGame CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.4.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: Install packages
|
||||
run: yarn --frozen-lockfile
|
||||
- name: Linting
|
||||
run: yarn lint
|
||||
- name: Typechecking
|
||||
run: yarn typecheck
|
||||
- name: Testing
|
||||
run: yarn test
|
||||
env:
|
||||
CI: true
|
||||
@@ -21,6 +21,7 @@
|
||||
"hasura:migrate:init": "npm run hasura migrate create \"init\" -- --from-server",
|
||||
"hasura:migrate:apply": "npm run hasura migrate apply",
|
||||
"test": "lerna run test --parallel",
|
||||
"test:full": "yarn lint && yarn typecheck && yarn test",
|
||||
"clean": "lerna clean",
|
||||
"format": "prettier --ignore-path .gitignore --write \"{*,**/*}.{ts,tsx,js,jsx,json,yml,yaml,md}\"",
|
||||
"lint": "eslint --ignore-path .gitignore \"./packages/**/*.{ts,tsx,js,jsx}\"",
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"dev": "yarn start",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"precommit": "yarn lint-staged"
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { App } from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
const { getByText } = render(<App />);
|
||||
const linkElement = getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
Reference in New Issue
Block a user