forked from asyncapi/studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3bc016
commit 158a16b
Showing
1 changed file
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,68 @@ | ||
name: Check test coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
name: Check test coverage | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
test-coveralls: | ||
name: Test and Run Coveralls | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: npm install, run test | ||
run: | | ||
npm install | ||
npm run test | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- if: > | ||
!github.event.pull_request.draft && !( | ||
(github.actor == 'asyncapi-bot' && ( | ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || | ||
startsWith(github.event.pull_request.title, 'chore(release):') | ||
)) || | ||
(github.actor == 'asyncapi-bot-eve' && ( | ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || | ||
startsWith(github.event.pull_request.title, 'chore(release):') | ||
)) || | ||
(github.actor == 'allcontributors[bot]' && | ||
startsWith(github.event.pull_request.title, 'docs: add') | ||
) | ||
) | ||
id: should_run | ||
name: Should Run | ||
run: echo "shouldrun=true" >> $GITHUB_OUTPUT | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Check package-lock version | ||
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master | ||
id: lockversion | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "${{ steps.lockversion.outputs.version }}" | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Install dependencies | ||
id: first-installation | ||
run: npm install --loglevel verbose | ||
continue-on-error: true | ||
- if: steps.first-installation.outputs.status == 'failure' | ||
name: Clear NPM cache and install deps again | ||
run: | | ||
npm cache clean --force | ||
npm install --loglevel verbose | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Test | ||
run: npm test --if-present | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |