From cd4ed118ee41163f2c29cb2d483716e7f98f963d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Wed, 27 Jan 2021 11:49:31 +0100 Subject: [PATCH] add test steps to ga ci and remove travis --- .github/workflows/ci.yml | 132 ++++++++++++++++++++++++++++++++++----- .travis.yml | 58 ----------------- 2 files changed, 116 insertions(+), 74 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 202a575..f8e7b4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: check: - name: Lint + name: Lint and Typecheck runs-on: ubuntu-latest steps: - uses: actions/setup-node@v1 @@ -28,19 +28,119 @@ jobs: - run: yarn --prefer-offline --frozen-lockfile - run: yarn run check - run: yarn run build - - uses: ipfs/aegir/actions/bundle-size@master - name: Check bundle size - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + # LArge bundle because of node-forge and bcrypto + # - uses: ipfs/aegir/actions/bundle-size@master + # name: Check bundle size + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} - # ci: - # name: Build and Test - # strategy: - # matrix: - # node: [12, 14] - # os: ["ubuntu-latest", "macos-latest", "windows-latest"] - # runs-on: ${{ matrix.os }} - # steps: - # - uses: actions/setup-node@v1 - # with: - # node-version: ${{ matrix.node }} + test-node: + name: Test Nodejs + needs: check + strategy: + matrix: + node: [12, 14] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + runs-on: ${{ matrix.os }} + 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 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f12e4b3..0000000 --- a/.travis.yml +++ /dev/null @@ -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