Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
calintamas committed May 1, 2021
1 parent 3b2dfda commit 7b95254
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 8 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run linter

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12

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

- name: Restore yarn cache
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-
- name: Install dependencies
run: yarn --prefer-offline

- name: Setup React Native environment
run: |
yarn add react-native@0.63.4
yarn add react@16.13.1
- name: Run eslint
run: yarn lint
13 changes: 10 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,27 @@ on:
jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install -g yarn

- name: Install dependencies
run: yarn

- name: Setup React Native environment
run: |
yarn add react-native@0.63.4
yarn add react@16.13.1
- name: Run tests
run: yarn test

- id: publish
uses: JS-DevTools/npm-publish@v1
with:
Expand Down
32 changes: 27 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
name: tests
name: Run tests

on: [push, pull_request]
on: [push]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
rn_version: ['0.63.4', '0.64.0']

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install -g yarn

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

- name: Restore yarn cache
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-
- name: Install dependencies
run: yarn
run: yarn --prefer-offline

- name: Setup React Native environment
run: |
yarn add react-native@0.63.4
yarn add react-native@${{ matrix.rn_version }}
yarn add react@16.13.1
- name: Run tests
run: yarn test --coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down

0 comments on commit 7b95254

Please sign in to comment.