Skip to content

Commit

Permalink
use github actions (#3242)
Browse files Browse the repository at this point in the history
* use github actions

* remove travis

* fix step name

* do less work

* switch to bundlewatch

* set proper branch

* fix repo name env variable

* try running on branch instead
  • Loading branch information
quantizor committed Aug 30, 2020
1 parent 71c0fb8 commit 106e5bb
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 331 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,60 @@
name: test

on:
push:
branches:
- "*"

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: ["10", "12", "14"]
steps:
- uses: actions/checkout@v2

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --pure-lockfile

- name: Jest
run: yarn test

- name: Flow
run: yarn flow
if: matrix.node == '10'

- name: Lint
run: yarn lint
if: matrix.node == '10'

- name: Build
run: yarn build
if: matrix.node == '10'
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
CI_BRANCH: ${{ steps.extract_branch.outputs.branch }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_REPO_NAME: ${{ github.event.repository.name }}
CI_REPO_OWNER: ${{ github.repository_owner }}
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -39,7 +39,7 @@
"babel-plugin-macros": "^2.5.1",
"babel-plugin-tester": "^6.0.1",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"bundlesize": "^0.17.1",
"bundlewatch": "^0.2.7",
"cross-env": "^5.1.3",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
Expand Down
16 changes: 9 additions & 7 deletions packages/styled-components/package.json
Expand Up @@ -28,7 +28,7 @@
"test:integration": "jest -c ../../scripts/jest/config.integration.js --runInBand --forceExit",
"format": "eslint ./**/*.js --fix",
"lint": "eslint src",
"lint:size": "bundlesize",
"lint:size": "bundlewatch",
"prettier": "prettier */**/*.js --write",
"prepublishOnly": "npm run build",
"dev": "cross-env BABEL_ENV=cjs babel-node example/startServer.js"
Expand Down Expand Up @@ -106,12 +106,14 @@
"rollup-plugin-terser": "^5.0.0",
"stylis-plugin-rtl": "^1.0.0"
},
"bundlesize": [
{
"path": "./dist/styled-components.min.js",
"maxSize": "14kB"
}
],
"bundlewatch": {
"files": [
{
"path": "./dist/styled-components.min.js",
"maxSize": "13kB"
}
]
},
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/styled-components"
Expand Down

0 comments on commit 106e5bb

Please sign in to comment.