2022-10-01 02:31:00 +03:00
|
|
|
name: Continuous Integration Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- v6-beta-exports
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
test-node:
|
|
|
|
|
2022-10-01 03:24:29 +03:00
|
|
|
name: Run Node.js Tests
|
2022-10-01 03:05:00 +03:00
|
|
|
|
2022-10-01 02:31:00 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-10-20 12:04:12 +03:00
|
|
|
environment: ethers-tests
|
|
|
|
env:
|
|
|
|
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
|
|
|
|
|
2022-10-01 02:31:00 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
node-version: [ 16.x, 18.x ]
|
2022-10-01 02:38:49 +03:00
|
|
|
test-type: [ esm, commonjs ]
|
|
|
|
|
2022-10-01 02:31:00 +03:00
|
|
|
steps:
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: "v6-beta-exports"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Build ESM and CommonJS (from TypeScript)
|
|
|
|
run: npm run build-all
|
|
|
|
|
|
|
|
- name: Run tests (${{ matrix.test-type }})
|
2022-10-01 02:38:49 +03:00
|
|
|
run: npm run test-${{ matrix.test-type }}
|
2022-10-01 02:31:00 +03:00
|
|
|
|
|
|
|
|
|
|
|
coverage:
|
|
|
|
|
2022-10-01 03:24:29 +03:00
|
|
|
name: Generate Coverage Report
|
2022-10-01 02:31:00 +03:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-10-20 12:04:12 +03:00
|
|
|
environment: ethers-tests
|
|
|
|
env:
|
|
|
|
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
|
|
|
|
|
2022-10-01 02:31:00 +03:00
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2022-10-01 03:10:10 +03:00
|
|
|
node-version: 18.x
|
2022-10-01 02:31:00 +03:00
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: "v6-beta-exports"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Build ESM (from TypeScript)
|
|
|
|
run: npm run build
|
|
|
|
|
2022-11-09 10:58:06 +03:00
|
|
|
- name: Run coverage tests
|
2022-10-01 02:31:00 +03:00
|
|
|
run: npm run test-coverage
|
|
|
|
|
2022-11-09 10:58:06 +03:00
|
|
|
- name: Store coverage summary artifact
|
2022-10-01 02:31:00 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: coverage-summary
|
|
|
|
path: ./output/summary.txt
|
|
|
|
|
2022-11-09 10:58:06 +03:00
|
|
|
- name: Tar coverage files
|
2022-10-01 02:31:00 +03:00
|
|
|
run: tar -cvf ./output/coverage.tar ./output/lcov-report/
|
|
|
|
|
2022-11-09 10:58:06 +03:00
|
|
|
- name: Store full coverage artifact
|
2022-10-01 02:31:00 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: coverage-complete
|
|
|
|
path: ./output/coverage.tar
|
2022-10-21 02:51:11 +03:00
|
|
|
|
2022-10-21 03:57:38 +03:00
|
|
|
- name: Upload coverage to to build.ethers.org
|
2022-10-21 02:54:28 +03:00
|
|
|
uses: ethers-io/sync-s3-action@main
|
2022-10-21 02:51:11 +03:00
|
|
|
with:
|
|
|
|
aws_access_key_id: ${{ secrets.BUILD_AWS_ACCESS_KEY_ID }}
|
|
|
|
aws_secret_access_key: ${{ secrets.BUILD_AWS_SECRET_ACCESS_KEY}}
|
2022-10-21 03:57:38 +03:00
|
|
|
aws_s3_bucket: ethers.org
|
2022-10-21 02:51:11 +03:00
|
|
|
source_folder: 'output/'
|
2022-10-21 03:57:38 +03:00
|
|
|
destination_prefix: 'build/output/'
|
2022-10-21 02:51:11 +03:00
|
|
|
aws_cloudfront_id: ${{ secrets.BUILD_AWS_CLOUDFRONT_ID }}
|