Skip to content

Commit

Permalink
Create a PR workflow using Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
boaz0 committed Jan 22, 2020
1 parent b9eed24 commit 4eb0f5c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/bot.yml
@@ -0,0 +1,24 @@
name: 🤖 Koku/UI bot

on: [pull_request]

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: fun-stuff
env:
JOB_CTX: ${{ toJson(job) }}
run: echo "${JOB_CTX}"
- uses: actions/github-script@0.4.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.checks.listForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.repo.ref
})
61 changes: 61 additions & 0 deletions .github/workflows/pr_ci.yml
@@ -0,0 +1,61 @@
name: 🤞 Koku/UI CI (PR)

on:
pull_request:
branches:
- master

jobs:
lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Use Node.js 8.x
uses: actions/setup-node@v1
with:
version: 8.x
- name: get yarn cache dir
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: installation
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: lint
run: yarn lint

unit-tests:

needs: [lint]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Use Node.js 8.x
uses: actions/setup-node@v1
with:
version: 8.x
- name: get yarn cache dir
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: installation
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: unit tests
run: yarn test --coverage --maxWorkers=4
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

4 changes: 0 additions & 4 deletions .travis.yml
Expand Up @@ -3,13 +3,9 @@ sudo: false
node_js:
- "8"
cache: yarn
before_script: yarn global add codecov
script:
- yarn lint
- yarn test --coverage --maxWorkers=4
- yarn build
after_success:
- codecov
- curl -sSL https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master/src/bootstrap.sh | bash -s
env:
global:
Expand Down

0 comments on commit 4eb0f5c

Please sign in to comment.