Skip to content

Commit

Permalink
Chore: Update CI/CD configurations ⚙️ (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
DHedgecock committed Apr 24, 2020
1 parent 1f061e1 commit 17de156
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
35 changes: 9 additions & 26 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
name: CI/CD

# Run action on all PRS and on change to master branch in order to test PRs for
# continuous integration and deploy master for continuous deployment
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
on: [push]

jobs:
skip:
name: CI Skip
if: contains(github.event.head_commit.message, 'skip ci')
runs-on: ubuntu-latest
steps:
- name: Skip CI Commit
run: echo "Skip CI commit success"
# --- Package testing ✅
test:
name: Continuous Integration
if: contains(github.event.head_commit.message, 'skip ci') == false
Expand All @@ -26,16 +12,14 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '12.16'
- name: Code Climate - Setup
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Install
run: npm install
env:
CI: 'true'
run: CI=true npm install
- name: Test
run: npm test
- name: Code Climate - Report
Expand All @@ -46,9 +30,10 @@ jobs:
env:
# Add required git env values for code cov reporting, ref:
# https://docs.codeclimate.com/docs/github-actions-test-coverage
GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
GIT_BRANCH: ${{ github.head_ref }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GIT_BRANCH: ${{ github.head_ref }}

# --- Package publishing 🚀
publish:
name: Continuous Deployment
if: github.ref == 'refs/heads/master'
Expand All @@ -59,11 +44,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '12.16'
- name: Install
run: npm install
env:
CI: 'true'
run: CI=true npm install
- name: Semantic Release
run: npx semantic-release
env:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"scripts": {
"babel:watch": "BABEL_ENV=development babel src --extensions '.ts,.tsx' --watch --out-dir dist --ignore '**/*.spec.js'",
"test": "npm run test:lint && npm run test:unit",
"test:lint": "NODE_ENV=test eslint --format=pretty src",
"test:lint": "NODE_ENV=test eslint --format=pretty --ext .js,.ts __mocks__ src",
"test:unit": "jest src",
"type-check": "tsc --noEmit",
"type-check:watch": "tsc --noEmit --watch",
"format": "prettier --write '*.{js,json,md}' '**/*.{js,json,md,mdx,scss}' !CHANGELOG.md",
"format": "prettier --write '*.{js,json,md,ts}' '**/*.{js,json,md,ts}' !CHANGELOG.md",
"prepublishOnly": "npm run clean && npm run types && npm run js",
"postpublish": "npm run clean",
"js": "BABEL_ENV=production babel src --extensions '.ts,.tsx' --out-dir dist --ignore '**/*.spec.js'",
Expand Down

0 comments on commit 17de156

Please sign in to comment.