refactor: rename swap function in BuyGDClone contract for clarity #1102
This file contains hidden or 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 -r '.[${{ matrix.chunk }}][]|@sh') | |
| echo $TESTFILES | |
| echo $TESTFILES | xargs yarn test |