Skip to content

Commit

Permalink
fix: tests for helpers
Browse files Browse the repository at this point in the history
1. Add coveralls
2. Setup semantic release
  • Loading branch information
rajasegar committed May 17, 2020
1 parent 5f177a8 commit 8b72ebe
Show file tree
Hide file tree
Showing 39 changed files with 1,432 additions and 134 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/deploy-to-gh-pages.yml

This file was deleted.

106 changes: 87 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,91 @@
name: Build
name: Build and Deploy
on:
- pull_request

push:
branches:
- master
jobs:
lint_and_test:
lint:
name: Lint
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v1
- name: Pnpm setup
uses: pnpm/[email protected]
with:
version: 4.11.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: ESLint
run: pnpm run lint:js
- name: Templates
run: pnpm run lint:hbs

coverage:
name: Coverage
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: pnpm/[email protected]
with:
version: 4.11.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm run lint:js
- run: pnpm run lint:hbs
- run: pnpm test

- uses: actions/checkout@v1
- name: pnpm run install, run coveralls
env:
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
run: |
pnpm run test:ember
pnpm run coveralls
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

tests_ember_compat:
name: Ember Compatability
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
scenario:
- "ember-lts-3.16"
- "ember-release"
- "ember-beta"
steps:
- uses: actions/checkout@v1
- name: Test with ${{ matrix.scenario }}
run: pnpm run test:ember-compatibility ${{ matrix.scenario }}

build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Pnpm setup
uses: pnpm/[email protected]
with:
version: 4.11.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Build
run: |
pnpm run build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run semantic-release

23 changes: 23 additions & 0 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build
on:
- pull_request

jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: pnpm/[email protected]
with:
version: 4.11.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm run lint:js
- run: pnpm run lint:hbs
- run: pnpm test
26 changes: 25 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"scripts": {
"build": "ember build --environment=production",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
Expand All @@ -36,8 +37,11 @@
"@ember/optional-features": "^1.3.0",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"coveralls": "^3.1.0",
"ember-cli": "~3.17.0",
"ember-cli-code-coverage": "github:kategengler/ember-cli-code-coverage#v1.0.0-beta.9",
"ember-cli-dependency-checker": "^3.2.0",
Expand All @@ -59,7 +63,8 @@
"eslint-plugin-node": "^11.0.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.1.0"
"qunit-dom": "^1.1.0",
"semantic-release": "^17.0.7"
},
"engines": {
"node": "10.* || >= 12"
Expand All @@ -69,5 +74,24 @@
},
"ember-addon": {
"configPath": "tests/dummy/config"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md"
],
"message": "release(version): Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
}
Loading

0 comments on commit 8b72ebe

Please sign in to comment.