-
Notifications
You must be signed in to change notification settings - Fork 9
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
043b5ad
commit eeebef1
Showing
3 changed files
with
225 additions
and
109 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 |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# This is a Github Workflow that runs tests on any push or pull request. | ||
# If the tests pass and this is a push to the master branch it also runs Semantic Release. | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- run: yarn | ||
- run: yarn build | ||
|
||
- name: Save target | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: target | ||
retention-days: 1 | ||
path: | | ||
docs | ||
target | ||
flow-typed | ||
typings | ||
buildstamp.json | ||
test_fast: | ||
needs: build | ||
if: github.event_name == 'push' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Restore target | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- run: yarn | ||
- name: Unit test only | ||
run: yarn test:unit | ||
- name: Push coverage | ||
if: github.ref == 'refs/heads/master' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: target | ||
retention-days: 1 | ||
path: coverage | ||
|
||
test: | ||
if: github.event_name == 'pull_request' | ||
strategy: | ||
matrix: | ||
os: [ windows-2019, ubuntu-20.04 ] | ||
node-version: [ 12, 14 ] | ||
name: Test (Node v${{ matrix.node-version }}, OS ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Restore target | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: yarn | ||
- name: Intergarion test | ||
if: matrix.node-version != '14' || matrix.os != 'ubuntu-20.04' | ||
run: yarn test:integration | ||
- name: Full test suite | ||
if: matrix.node-version == '14' && matrix.os == 'ubuntu-20.04' | ||
run: yarn test | ||
|
||
release: | ||
name: Release | ||
# https://github.community/t/trigger-job-on-tag-push-only/18076 | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-20.04 | ||
needs: test_fast | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Restore target | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Codeclimate | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
with: | ||
coverageLocations: | | ||
${{github.workspace}}/coverage/*.lcov:lcov | ||
- name: Coveralls | ||
run: yarn push:report | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
with: | ||
extends: | | ||
@qiwi/semrel-config | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GIT_AUTHOR_EMAIL: '[email protected]' | ||
GIT_COMMITTER_EMAIL: '[email protected]' | ||
GIT_AUTHOR_NAME: '@antongolub' | ||
GIT_COMMITTER_NAME: '@antongolub' |
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 |
---|---|---|
@@ -1,92 +1,94 @@ | ||
language: node_js | ||
cache: yarn | ||
node_js: 14 | ||
install: skip | ||
os: linux | ||
dist: focal | ||
branch: foobarbaz | ||
|
||
jobs: | ||
fast_finish: true | ||
include: | ||
- stage: verify | ||
if: branch != master AND type != pull_request | ||
install: yarn | ||
script: | ||
- yarn build | ||
- if [ "$CI_TEST" != "false" ]; then | ||
yarn test; | ||
fi | ||
- &build | ||
stage: build | ||
if: branch = master | ||
install: yarn | ||
script: yarn build | ||
# https://docs.travis-ci.com/user/using-workspaces/ | ||
workspaces: | ||
create: | ||
name: linux-shared | ||
paths: | ||
- target | ||
- flow-typed | ||
- typings | ||
- docs | ||
- node_modules | ||
- <<: *build | ||
os: windows | ||
if: branch = master AND env(CI_WIN_BUILD) = true AND type = pull_request | ||
# https://travis-ci.community/t/timeout-after-build-finished-and-succeeded/1336/2 | ||
env: YARN_GPG=no | ||
workspaces: | ||
create: | ||
name: win-shared | ||
paths: | ||
- target | ||
- node_modules | ||
|
||
- &test | ||
if: branch = master AND type = pull_request AND env(CI_TEST) != false | ||
stage: test | ||
install: skip | ||
script: yarn test | ||
workspaces: | ||
use: linux-shared | ||
- <<: *test | ||
node_js: 12 | ||
script: yarn test:integration | ||
- <<: *test | ||
node_js: 15 | ||
script: yarn test:integration | ||
- <<: *test | ||
if: branch = master AND type != pull_request AND env(CI_TEST) != false | ||
before_script: | ||
- if [ "$CC_TEST_REPORTER_ID" != "" ]; then | ||
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; | ||
fi | ||
script: | ||
- if [ "$CC_TEST_REPORTER_ID" != "" ]; then | ||
yarn test:report; | ||
else | ||
yarn test; | ||
fi | ||
after_script: | ||
- if [ "$CC_TEST_REPORTER_ID" != "" ]; then | ||
./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info; | ||
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; | ||
fi | ||
- <<: *test | ||
if: branch = master AND type = pull_request AND env(CI_WIN_BUILD) = true AND env(CI_TEST) != false | ||
os: windows | ||
script: yarn test:integration | ||
env: YARN_GPG=no | ||
workspaces: | ||
use: win-shared | ||
|
||
- stage: release | ||
if: branch = master AND type != pull_request AND env(CI_RELEASE) = true | ||
workspaces: | ||
use: linux-shared | ||
install: skip | ||
script: yarn release | ||
# script: echo 'Deploy step is disabled' && exit 0 | ||
#language: node_js | ||
#cache: yarn | ||
#node_js: 14 | ||
#install: skip | ||
#os: linux | ||
#dist: focal | ||
# | ||
#jobs: | ||
# fast_finish: true | ||
# include: | ||
# - stage: verify | ||
# if: branch != master AND type != pull_request | ||
# install: yarn | ||
# script: | ||
# - yarn build | ||
# - if [ "$CI_TEST" != "false" ]; then | ||
# yarn test; | ||
# fi | ||
# - &build | ||
# stage: build | ||
# if: branch = master | ||
# install: yarn | ||
# script: yarn build | ||
# # https://docs.travis-ci.com/user/using-workspaces/ | ||
# workspaces: | ||
# create: | ||
# name: linux-shared | ||
# paths: | ||
# - target | ||
# - flow-typed | ||
# - typings | ||
# - docs | ||
# - node_modules | ||
# - <<: *build | ||
# os: windows | ||
# if: branch = master AND env(CI_WIN_BUILD) = true AND type = pull_request | ||
# # https://travis-ci.community/t/timeout-after-build-finished-and-succeeded/1336/2 | ||
# env: YARN_GPG=no | ||
# workspaces: | ||
# create: | ||
# name: win-shared | ||
# paths: | ||
# - target | ||
# - node_modules | ||
# | ||
# - &test | ||
# if: branch = master AND type = pull_request AND env(CI_TEST) != false | ||
# stage: test | ||
# install: skip | ||
# script: yarn test | ||
# workspaces: | ||
# use: linux-shared | ||
# - <<: *test | ||
# node_js: 12 | ||
# script: yarn test:integration | ||
# - <<: *test | ||
# node_js: 15 | ||
# script: yarn test:integration | ||
# - <<: *test | ||
# if: branch = master AND type != pull_request AND env(CI_TEST) != false | ||
# before_script: | ||
# - if [ "$CC_TEST_REPORTER_ID" != "" ]; then | ||
# 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; | ||
# fi | ||
# script: | ||
# - if [ "$CC_TEST_REPORTER_ID" != "" ]; then | ||
# yarn test:report; | ||
# else | ||
# yarn test; | ||
# fi | ||
# after_script: | ||
# - if [ "$CC_TEST_REPORTER_ID" != "" ]; then | ||
# ./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info; | ||
# ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; | ||
# fi | ||
# - <<: *test | ||
# if: branch = master AND type = pull_request AND env(CI_WIN_BUILD) = true AND env(CI_TEST) != false | ||
# os: windows | ||
# script: yarn test:integration | ||
# env: YARN_GPG=no | ||
# workspaces: | ||
# use: win-shared | ||
# | ||
# - stage: release | ||
# if: branch = master AND type != pull_request AND env(CI_RELEASE) = true | ||
# workspaces: | ||
# use: linux-shared | ||
# install: skip | ||
# script: yarn release | ||
# # script: echo 'Deploy step is disabled' && exit 0 |