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

146 lines
3.5 KiB
YAML
Raw Permalink Normal View History

2022-12-05 22:19:41 -05:00
name: CI Tests
2022-09-30 19:31:00 -04:00
on:
push:
branches:
- v6
2022-09-30 19:31:00 -04:00
jobs:
test-node:
2022-12-03 17:02:20 -05:00
#if: ${{ false }} # disable for now
2022-09-30 19:31:00 -04:00
2022-09-30 20:24:29 -04:00
name: Run Node.js Tests
2022-09-30 20:05:00 -04:00
2022-09-30 19:31:00 -04:00
runs-on: ubuntu-latest
2022-10-20 05:04:12 -04:00
environment: ethers-tests
env:
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
2022-09-30 19:31:00 -04:00
strategy:
fail-fast: false
matrix:
node-version: [ 16.x, 18.x ]
2022-09-30 19:38:49 -04:00
test-type: [ esm, commonjs ]
2022-09-30 19:31:00 -04: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"
2022-09-30 19:31:00 -04:00
- 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-09-30 19:38:49 -04:00
run: npm run test-${{ matrix.test-type }}
2022-09-30 19:31:00 -04:00
coverage:
2022-12-03 17:02:20 -05:00
#if: ${{ false }} # disable for now
2022-09-30 19:31:00 -04:00
2022-09-30 20:24:29 -04:00
name: Generate Coverage Report
2022-09-30 19:31:00 -04:00
runs-on: ubuntu-latest
2022-10-20 05:04:12 -04:00
environment: ethers-tests
env:
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
2022-09-30 19:31:00 -04:00
continue-on-error: true
steps:
- uses: actions/setup-node@v1
with:
node-version: 18.x
2022-09-30 19:31:00 -04:00
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: "v6"
2022-09-30 19:31:00 -04:00
- name: Install dependencies
run: npm ci
- name: Build ESM (from TypeScript)
run: npm run build
2022-11-09 02:58:06 -05:00
- name: Run coverage tests
2022-09-30 19:31:00 -04:00
run: npm run test-coverage
2022-11-09 02:58:06 -05:00
- name: Store coverage summary artifact
2022-09-30 19:31:00 -04:00
uses: actions/upload-artifact@v2
with:
name: coverage-summary
path: ./output/summary.txt
2022-11-09 02:58:06 -05:00
- name: Tar coverage files
2022-09-30 19:31:00 -04:00
run: tar -cvf ./output/coverage.tar ./output/lcov-report/
2022-11-09 02:58:06 -05:00
- name: Store full coverage artifact
2022-09-30 19:31:00 -04:00
uses: actions/upload-artifact@v2
with:
name: coverage-complete
path: ./output/coverage.tar
2022-10-20 19:51:11 -04:00
2022-10-20 20:57:38 -04:00
- name: Upload coverage to to build.ethers.org
2022-10-20 19:54:28 -04:00
uses: ethers-io/sync-s3-action@main
2022-10-20 19:51:11 -04:00
with:
aws_access_key_id: ${{ secrets.BUILD_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.BUILD_AWS_SECRET_ACCESS_KEY}}
2022-10-20 20:57:38 -04:00
aws_s3_bucket: ethers.org
2022-10-20 19:51:11 -04:00
source_folder: 'output/'
2022-10-20 20:57:38 -04:00
destination_prefix: 'build/output/'
2022-10-20 19:51:11 -04:00
aws_cloudfront_id: ${{ secrets.BUILD_AWS_CLOUDFRONT_ID }}
2022-12-02 22:45:03 -05: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 03:39:10 -05:00
uses: actions/checkout@v3
2022-12-02 22:45:03 -05:00
with:
ref: "v6"
2022-12-11 03:39:10 -05:00
fetch-depth: "0"
2022-12-02 22:45:03 -05: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 14:05:25 -05: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 14:05:25 -05:00
aws_cloudfront_id: ${{ secrets.DOCS_AWS_CLOUDFRONT_ID }}