Skip to content

Commit

Permalink
Merge pull request #306 from christianvuerings/github-workflows
Browse files Browse the repository at this point in the history
Use GitHub actions instead of Travis CI
  • Loading branch information
vzaidman authored Sep 15, 2024
2 parents 27bcd72 + 6b10cf0 commit 088d196
Show file tree
Hide file tree
Showing 6 changed files with 799 additions and 869 deletions.
19 changes: 19 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Setup Node.js and dependencies'
description: 'Sets up Node.js, caches dependencies, and installs packages'
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
shell: bash
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: master
pull_request:
branches: master

jobs:
cypress-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run Cypress tests
run: yarn cypress:ci

cypress-tests-classic:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run Cypress tests
run: yarn cypress:ci:classic

unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: yarn test:ci

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: yarn lint

audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: yarn audit
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Why Did You Render

[![npm version](https://badge.fury.io/js/%40welldone-software%2Fwhy-did-you-render.svg)](https://badge.fury.io/js/%40welldone-software%2Fwhy-did-you-render)
[![Build Status](https://travis-ci.com/welldone-software/why-did-you-render.svg?branch=master)](https://travis-ci.com/welldone-software/why-did-you-render)
[![Build Status](https://github.com/welldone-software/why-did-you-render/actions/workflows/main.yml/badge.svg)](https://github.com/welldone-software/why-did-you-render/actions/workflows/main.yml)
![NPM](https://img.shields.io/npm/l/@welldone-software/why-did-you-render?style=flat)
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/@welldone-software/why-did-you-render)
[![Coverage Status](https://coveralls.io/repos/github/welldone-software/why-did-you-render/badge.svg?branch=add-e2e-tests-using-cypress)](https://coveralls.io/github/welldone-software/why-did-you-render?branch=add-e2e-tests-using-cypress)
Expand Down Expand Up @@ -198,7 +198,7 @@ EnhancedMenu.whyDidYouRender = {
```js
withPropsOnChange(withPropsOnChange(withStateHandlers(withPropsOnChange(withState(withPropsOnChange(lifecycle(withPropsOnChange(withPropsOnChange(onlyUpdateForKeys(LoadNamespace(Connect(withState(withState(withPropsOnChange(lifecycle(withPropsOnChange(withHandlers(withHandlers(withHandlers(withHandlers(Connect(lifecycle(Menu)))))))))))))))))))))))
```

## Options
Optionally you can pass in `options` as the second parameter. The following options are available:
- `include: [RegExp, ...]` (`null` by default)
Expand Down Expand Up @@ -323,7 +323,7 @@ You can provide a function that harvests additional data from the original react
* If you only track pure components using `trackAllPureComponents: true` then you would only track either ([React.PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent) or [React.memo](https://reactjs.org/docs/react-api.html#reactmemo)), maybe none of your components are pure so none of them will get tracked.
* Maybe you have no issues
* Try causing an issue by temporary rendering the whole app twice in it's entry point:

`index.js`:
```jsx
const HotApp = hot(App);
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:classic": "cross-env USE_CLASSIC_JSX=true yarn _test",
"_test": "jest --config=jest.config.js",
"test:watch": "yarn test:automatic --watch",
"test:ci": "yarn test --coverage && coveralls < coverage/lcov.info",
"test:ci": "yarn test --coverage",
"lint": "eslint . --ext=js --max-warnings 0 --cache --cache-location .cache/eslint-cache",
"clear": "rimraf .cache dist demo/dist",
"watch": "concurrently --names \"Serve,Test\" \"npm:start\" \"npm:test:watch\"",
Expand All @@ -44,8 +44,8 @@
"postversion": "git push && git push --tags",
"cypress:open": "cypress open",
"cypress:run": "cypress run --browser chrome",
"_cypress:run:ci": "yarn cypress:run --record --parallel --group main",
"_cypress:run:ci:classic": "yarn cypress:run --record --parallel --group classic",
"_cypress:run:ci": "yarn cypress:run --record --group main",
"_cypress:run:ci:classic": "yarn cypress:run --record --group classic",
"cypress:ci": "start-server-and-test start http://localhost:3003 _cypress:run:ci",
"cypress:ci:classic": "start-server-and-test start:classic http://localhost:3003 _cypress:run:ci:classic"
},
Expand All @@ -54,16 +54,16 @@
"bump version": "npm version major/minor/patch"
},
"resolutions": {
"coveralls": [
"removed while it's not passing the audit and travis doesn't work"
"eslint@^8": [
"react eslint plugins doesn't play nicely with eslint 9 so we force using eslint 8 for now"
],
"source-map@^0.7.4": [
"fixes https://github.com/mozilla/source-map/issues/432 or we get:",
"forces nollup to use source-map 0.8.0-beta.0 or higher.",
"will be resolved when nollup is updated to use it"
],
"eslint@^8": [
"react eslint plugins doesn't play nicely with eslint 9 so we force using eslint 8 for now"
"string-width": [
"fixes require() of ES Module issue"
]
}
},
Expand All @@ -75,7 +75,8 @@
},
"resolutions": {
"source-map-fast": "npm:source-map@^0.8.0-beta.0",
"source-map": "^0.8.0-beta.0"
"source-map": "^0.8.0-beta.0",
"string-width": "4.2.3"
},
"devDependencies": {
"@babel/cli": "^7.24.7",
Expand Down
Loading

0 comments on commit 088d196

Please sign in to comment.