revert: initial reserve deposit #914
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: push | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} | |
test-chunk-ids: ${{ steps['set-test-chunk-ids'].outputs['test-chunk-ids'] }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-test-chunks | |
name: Set Chunks | |
run: echo "::set-output name=test-chunks::$(find test -name '*.ts' | jq -R -s -c 'split("\n")[:-1]' | jq -cM '[_nwise(length / 5 | floor)]')" | |
- id: set-test-chunk-ids | |
name: Set Chunk IDs | |
run: echo "::set-output name=test-chunk-ids::$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" | |
env: | |
CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} | |
test: | |
runs-on: ubuntu-latest | |
needs: setup | |
name: test (chunk ${{ matrix.chunk }}) | |
strategy: | |
matrix: | |
chunk: ${{ fromJson(needs.setup.outputs['test-chunk-ids']) }} | |
env: | |
CHUNKS: ${{ needs.setup.outputs['test-chunks'] }} | |
HARDHAT_MAX_MEMORY: 6096 | |
NODE_OPTIONS: "--max-old-space-size=6096" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
cache: "yarn" | |
- run: npm install -g yarn | |
- name: Create env file | |
run: | | |
touch .env | |
echo MNEMONIC="dasdasds" >> .env | |
echo TEST="true" >> .env | |
cat .env | |
- name: Install project dependencies | |
run: yarn install --immutable | |
- run: yarn compile | |
- name: Run tests | |
run: | | |
export TESTFILES=$(echo $CHUNKS | jq '.[${{ matrix.chunk }}][]') | |
echo $TESTFILES | |
yarn test:parallel $TESTFILES | |
coverage: | |
runs-on: ubuntu-latest | |
needs: setup | |
name: test (chunk ${{ matrix.chunk }}) | |
strategy: | |
matrix: | |
chunk: ${{ fromJson(needs.setup.outputs['test-chunk-ids']) }} | |
env: | |
CHUNKS: ${{ needs.setup.outputs['test-chunks'] }} | |
HARDHAT_MAX_MEMORY: 6096 | |
NODE_OPTIONS: "--max-old-space-size=6096" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
cache: "yarn" | |
- name: Create env file | |
run: | | |
touch .env | |
echo MNEMONIC="dasdasds" >> .env | |
echo TEST="true" >> .env | |
cat .env | |
- name: Install project | |
run: | | |
yarn install --immutable | |
yarn compile | |
- name: Run coverage | |
run: | | |
export TESTFILES=\"$(echo $CHUNKS | jq -r '.[${{ matrix.chunk }}] | join("\",\"")')\" | |
echo $TESTFILES | |
yarn coverage --testfiles "{$TESTFILES}" | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel: true | |
flag-name: run-${{ matrix.chunk }} | |
coverage-done: | |
needs: coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true | |
deploy: | |
runs-on: ubuntu-latest | |
name: "version bump and publish to npm" | |
needs: test | |
if: github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, 'BETA:') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
cache: "yarn" | |
#some mnemonic is requried in .env for hardhat config to compile | |
- name: Create env file | |
run: | | |
touch .env | |
echo MNEMONIC="dasdasds" >> .env | |
- name: "build" | |
run: | | |
yarn install --immutable | |
yarn compile | |
yarn build:test-sdk | |
yarn minimize | |
- name: Automated Version Bump | |
uses: phips28/gh-action-bump-version@master | |
with: | |
patch-wording: "RELEASE" | |
default: prerelease | |
preid: beta | |
rc-wording: "" | |
target-branch: ${{ env.GITHUB_REF_NAME }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to npm | |
uses: aliberkhsl/npm-publish@master | |
with: | |
token: ${{ secrets.NPM_KEY_4BF8 }} | |
access: "public" |