add test steps to ga ci and remove travis

This commit is contained in:
Marin Petrunić 2021-01-27 11:49:31 +01:00
parent 1b13e579ce
commit cd4ed118ee
No known key found for this signature in database
GPG Key ID: 834D07135E110DA5
2 changed files with 116 additions and 74 deletions

View File

@ -8,7 +8,7 @@ on:
jobs: jobs:
check: check:
name: Lint name: Lint and Typecheck
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
@ -28,19 +28,119 @@ jobs:
- run: yarn --prefer-offline --frozen-lockfile - run: yarn --prefer-offline --frozen-lockfile
- run: yarn run check - run: yarn run check
- run: yarn run build - run: yarn run build
- uses: ipfs/aegir/actions/bundle-size@master # LArge bundle because of node-forge and bcrypto
name: Check bundle size # - uses: ipfs/aegir/actions/bundle-size@master
with: # name: Check bundle size
github_token: ${{ secrets.GITHUB_TOKEN }} # with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# ci: test-node:
# name: Build and Test name: Test Nodejs
# strategy: needs: check
# matrix: strategy:
# node: [12, 14] matrix:
# os: ["ubuntu-latest", "macos-latest", "windows-latest"] node: [12, 14]
# runs-on: ${{ matrix.os }} os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# steps: runs-on: ${{ matrix.os }}
# - uses: actions/setup-node@v1 steps:
# with: - uses: actions/setup-node@v1
# node-version: ${{ matrix.node }} with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --prefer-offline --frozen-lockfile
- run: npx nyc --reporter=lcov aegir test -t node -- --bail
- uses: codecov/codecov-action@v1
test-chrome:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --prefer-offline --frozen-lockfile
- run: npx aegir test -t browser -t webworker --bail
test-firefox:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --prefer-offline --frozen-lockfile
- run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless
test-electron-main:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --prefer-offline --frozen-lockfile
- run: npx xvfb-maybe aegir test -t electron-main --bail
test-electron-renderer:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --prefer-offline --frozen-lockfile
- run: npx xvfb-maybe aegir test -t electron-renderer --bail

View File

@ -1,58 +0,0 @@
language: node_js
cache: yarn
stages:
- check
- test
- cov
env:
- YARN_GPG=no
node_js:
- '12'
- '14'
os:
- linux
- osx
- windows
script: npx nyc -s yarn run test:node --bail
after_success:
- npm install -g travis-deploy-once
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then travis-deploy-once "npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov"; fi
jobs:
include:
- stage: check
script:
- yarn run check
- yarn run lint
- yarn run build
- stage: test
name: chrome
addons:
chrome: stable
script: npx aegir test -t browser -t webworker
- stage: test
name: firefox
addons:
firefox: latest
script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
- stage: test
name: electron-main
os: osx
script:
- npx aegir test -t electron-main --bail
- stage: test
name: electron-renderer
os: osx
script:
- npx aegir test -t electron-renderer --bail
notifications:
email: false