From 9d683e39b786c69f35e5a758dfc8e6881c840205 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 15 Oct 2021 12:51:19 +0100 Subject: [PATCH 1/6] chore: switch to github actions Replace travis with github actions --- .github/dependabot.yml | 8 +++++ .github/workflows/main.yml | 68 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 49 --------------------------- 3 files changed, 76 insertions(+), 49 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..de46e326 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "11:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..e1f143a7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,68 @@ +name: ci +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx aegir lint + - uses: gozala/typescript-error-reporter-action@v1.0.8 + - run: npx aegir build + - run: npx aegir dep-check + - uses: ipfs/aegir/actions/bundle-size@master + name: size + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + test-node: + needs: check + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + node: [14, 16] + fail-fast: true + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: npm install + - 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/checkout@v2 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail + test-firefox: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless + test-electron-main: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx xvfb-maybe aegir test -t electron-main --bail + test-electron-renderer: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npm run pretest + - run: npx xvfb-maybe aegir test -t electron-renderer --bail diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 404f8691..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -language: node_js -cache: npm - -branches: - only: - - master - - /^release\/.*$/ - -stages: - - check - - test - - cov - -node_js: - - 'lts/*' - - 'node' - -os: - - linux - - osx - - windows - -script: npx nyc -s npm run test:node -- --bail -after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov - -jobs: - include: - - stage: check - script: - - npx aegir build --no-types - - npx aegir dep-check - - npm run lint - - - stage: test - name: chrome - addons: - chrome: stable - script: - - npx aegir test -t browser - - - stage: test - name: firefox - addons: - firefox: latest - script: - - npx aegir test -t browser -- --browsers FirefoxHeadless - -notifications: - email: false From 471b2daa469120c220f5cff35a87bf23091fcbce Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 15 Oct 2021 13:32:09 +0100 Subject: [PATCH 2/6] chore: this module does not have types yet --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1f143a7..09ab856e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,6 @@ jobs: - uses: actions/checkout@v2 - run: npm install - run: npx aegir lint - - uses: gozala/typescript-error-reporter-action@v1.0.8 - run: npx aegir build - run: npx aegir dep-check - uses: ipfs/aegir/actions/bundle-size@master From b3ddce6847ad6db2bad5a870d4c4f2a806a914fb Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 15 Oct 2021 13:37:22 +0100 Subject: [PATCH 3/6] chore use npm scripts --- .github/workflows/main.yml | 14 +++++++------- package.json | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09ab856e..fe3a1486 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,9 +13,9 @@ jobs: steps: - uses: actions/checkout@v2 - run: npm install - - run: npx aegir lint - - run: npx aegir build - - run: npx aegir dep-check + - run: npm run lint + - run: npm run build + - run: npm run dep-check - uses: ipfs/aegir/actions/bundle-size@master name: size with: @@ -42,21 +42,21 @@ jobs: steps: - uses: actions/checkout@v2 - run: npm install - - run: npx aegir test -t browser -t webworker --bail + - run: npm run test -- -t browser -t webworker --bail test-firefox: needs: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: npm install - - run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless + - run: npm run test -- -t browser -t webworker --bail -- --browsers FirefoxHeadless test-electron-main: needs: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: npm install - - run: npx xvfb-maybe aegir test -t electron-main --bail + - run: npx xvfb-maybe npm run test -- -t electron-main --bail test-electron-renderer: needs: check runs-on: ubuntu-latest @@ -64,4 +64,4 @@ jobs: - uses: actions/checkout@v2 - run: npm install - run: npm run pretest - - run: npx xvfb-maybe aegir test -t electron-renderer --bail + - run: npx xvfb-maybe npm run test -- -t electron-renderer --bail diff --git a/package.json b/package.json index 5d6b8607..1489a437 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ ], "scripts": { "lint": "aegir lint", + "dep-check": "aegir dep-check", "build": "npm run build:proto && aegir build --no-types", "build:proto": "pbjs -t static-module -w commonjs -r libp2p-crypto-keys --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/keys/keys.js ./src/keys/keys.proto", "test": "aegir test", From c5642168d99241ee96aba0aa87dfbe1a9e921e25 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 15 Oct 2021 13:40:06 +0100 Subject: [PATCH 4/6] chore: bundle size --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1489a437..3d868805 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ }, "aegir": { "build": { - "bundlesizeMax": "116kB" + "bundlesizeMax": "117kB" } }, "engines": { From 547115eb1a12cc850b483ad7a45872a7e7490159 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 15 Oct 2021 13:44:09 +0100 Subject: [PATCH 5/6] chore: fix electron --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe3a1486..94199622 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: npm install - - run: npx xvfb-maybe npm run test -- -t electron-main --bail + - run: npx xvfb-maybe aegir test -t electron-main --bail test-electron-renderer: needs: check runs-on: ubuntu-latest @@ -64,4 +64,4 @@ jobs: - uses: actions/checkout@v2 - run: npm install - run: npm run pretest - - run: npx xvfb-maybe npm run test -- -t electron-renderer --bail + - run: npx xvfb-maybe aegir test -t electron-renderer --bail From a5d4f07726275b7c314f5967330fcd3838e42256 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 15 Oct 2021 13:52:32 +0100 Subject: [PATCH 6/6] chore: fix electron --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94199622..0a575aab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,5 +63,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: npm install - - run: npm run pretest - run: npx xvfb-maybe aegir test -t electron-renderer --bail