ethers.js/.github/workflows/test-ci.yml

146 lines
3.5 KiB
YAML
Raw Normal View History

2022-12-06 06:19:41 +03:00
name: CI Tests
2022-10-01 02:31:00 +03:00
on:
push:
branches:
- v6-beta-exports
jobs:
test-node:
2022-12-04 01:02:20 +03:00
#if: ${{ false }} # disable for now
2022-10-01 02:31:00 +03:00
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-12-04 01:02:20 +03:00
#if: ${{ false }} # disable for now
2022-10-01 02:31:00 +03:00
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:
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 }}
2022-12-03 06:45:03 +03:00
docs:
name: Generate Documentation
runs-on: ubuntu-latest
environment: ethers-tests
env:
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
continue-on-error: true
steps:
- uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Checkout repository
2022-12-11 11:39:10 +03:00
uses: actions/checkout@v3
2022-12-03 06:45:03 +03:00
with:
ref: "v6-beta-exports"
2022-12-11 11:39:10 +03:00
fetch-depth: "0"
2022-12-03 06:45:03 +03:00
- name: Install dependencies
run: npm ci
- name: Install Flatworm
run: npm install --no-save 'https://github.com/ricmoo/flatworm.git#tsdocs'
- name: Build Documentation
run: node node_modules/flatworm/lib/test-api-index ./docs.wrm/config.js
2022-12-03 22:05:25 +03:00
- name: Upload documentation to to docs.ethers.org
uses: ethers-io/sync-s3-action@main
with:
aws_access_key_id: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY}}
aws_s3_bucket: ethers.org
source_folder: 'output/docs/'
destination_prefix: 'docs/'
2022-12-03 22:05:25 +03:00
aws_cloudfront_id: ${{ secrets.DOCS_AWS_CLOUDFRONT_ID }}