Skip to content

Commit

Permalink
Chore: Configure CI/CD action ⚙️ (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
DHedgecock committed Feb 20, 2020
1 parent 04da02f commit c66f06e
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 14 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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

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"
test:
name: Continuous Integration
if: contains(github.event.head_commit.message, 'skip ci') == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- 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'
- name: Test
run: npm test
- name: Code Climate - Report
if: success()
run: ./cc-test-reporter after-build --prefix /usr/src
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<img src="https://snyk.io/test/github/crystal-ball/babel-base/badge.svg?targetFile=package.json" alt="Known vulnerabilities" valign="text-top" />
</a>
<a href="https://codeclimate.com/github/crystal-ball/babel-base/test_coverage">
<img src="https://api.codeclimate.com/v1/badges/b96df9f9f2fb844ee580/test_coverage" alt="Test coverage" valign="text-top" />
<img src="https://api.codeclimate.com/v1/badges/be98f6c629b6473bd3f6/test_coverage" alt="Test coverage" valign="text-top" />
</a>
<a href="https://codeclimate.com/github/crystal-ball/babel-base/maintainability">
<img src="https://api.codeclimate.com/v1/badges/b96df9f9f2fb844ee580/maintainability" alt="Maintainability" valign="text-top" />
<img src="https://api.codeclimate.com/v1/badges/be98f6c629b6473bd3f6/maintainability" alt="Maintainability" valign="text-top" />
</a>
<code>:status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>

Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,5 @@
"jest": "25.1.0",
"typescript": "3.7.5"
},
"browserslist": [
"node 12"
],
"prettier": "@crystal-ball/prettier-base"
}
13 changes: 4 additions & 9 deletions src/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Object {
Object {
"corejs": 3,
"modules": "commonjs",
"targets": "node 12",
"useBuiltIns": "entry",
},
],
Expand Down Expand Up @@ -68,9 +69,7 @@ Object {
Object {
"corejs": 3,
"modules": false,
"targets": Array [
"defaults",
],
"targets": "defaults",
"useBuiltIns": "entry",
},
],
Expand Down Expand Up @@ -122,9 +121,7 @@ Object {
Object {
"corejs": 3,
"modules": false,
"targets": Array [
"defaults",
],
"targets": "defaults",
"useBuiltIns": "entry",
},
],
Expand Down Expand Up @@ -176,9 +173,7 @@ Object {
Object {
"corejs": 3,
"modules": "commonjs",
"targets": Array [
"defaults",
],
"targets": "defaults",
"useBuiltIns": "entry",
},
],
Expand Down
2 changes: 2 additions & 0 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export default function nodeConfigs() {
// meet target environment using browserslist config.
'@babel/preset-env',
{
// Transpile to current LTS
targets: 'node 12',
// Transform modules to common js in test for Jest
// Disable module transformation in dev and prod builds to allow
// webpack to smart-manage modules.
Expand Down
3 changes: 3 additions & 0 deletions src/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export default function reactConfigs(env) {
[
'@babel/preset-env',
{
// Transpile to browserslist default versions, which is any browser
// that isn't dead and has >0.5% market share
targets: 'defaults',
// Transform modules to common js in test for Jest
// Disable module transformation in dev and prod builds to allow
// webpack to smart-manage modules.
Expand Down

0 comments on commit c66f06e

Please sign in to comment.