-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from mifi/master
Refactor and async/await
- Loading branch information
Showing
43 changed files
with
5,294 additions
and
4,831 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,3 +1,2 @@ | ||
node_modules/ | ||
lib/ | ||
fixture/ |
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
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Run all tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
# Integration tests are not yet ready to run in parallel | ||
max-parallel: 1 | ||
matrix: | ||
node: ['10', '12', '14'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- run: yarn | ||
- run: npm run lint | ||
- run: npm test | ||
env: | ||
TRANSLOADIT_KEY: ${{ secrets.TRANSLOADIT_KEY }} | ||
TRANSLOADIT_SECRET: ${{ secrets.TRANSLOADIT_SECRET }} | ||
|
||
- name: Generate the badge from the json-summary | ||
run: node test/generate-coverage-badge.js coverage/coverage-summary.json | ||
|
||
- name: Move HTML report and badge to the correct location | ||
run: | | ||
mv coverage/lcov-report static-build | ||
mv coverage-badge.svg static-build/ | ||
# *** BEGIN PUBLISH STATIC SITE STEPS *** | ||
# Use the standard checkout action to check out the destination repo to a separate directory | ||
# See https://github.com/mifi/github-action-push-static | ||
- uses: actions/checkout@v2 | ||
with: | ||
ssh-key: ${{ secrets.COVERAGE_REPO_SSH_PRIVATE_KEY }} | ||
repository: transloadit/node-sdk-coverage | ||
path: static-files-destination | ||
|
||
# Push coverage data | ||
- if: matrix.node == '10' | ||
run: | | ||
git config --global user.name github-actions | ||
git config --global user.email [email protected] | ||
# Remove existing files: | ||
rm -rf static-files-destination/* | ||
# Replace with new files: | ||
cp -a static-build/* static-files-destination/ | ||
cd static-files-destination | ||
git add . | ||
# git diff-index: to avoid doing the git commit failing if there are no changes to be commit | ||
git diff-index --quiet HEAD || git commit --message 'Static file updates' | ||
git push |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Pull request tests | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node: ['10', '12', '14'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- run: yarn | ||
- run: npm run lint | ||
- run: npm run test-unit |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ sample.js | |
|
||
npm-debug.log | ||
env.sh | ||
/coverage |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.