diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf9b26b1..ceb0b25e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,19 +28,16 @@ jobs: node-version: '16.17.1' - name: Install npm dependencies - run: | - cd matic-cli - npm install --prefer-offline --no-audit --progress=false + working-directory: matic-cli + run: npm install --prefer-offline --no-audit --progress=false - name: Run prettier - run: | - cd matic-cli - npm run prettier:check + working-directory: matic-cli + run: npm run prettier:check - name: Run lint - run: | - cd matic-cli - npm run lint:check + working-directory: matic-cli + run: npm run lint:check integration-tests: permissions: @@ -57,8 +54,8 @@ jobs: path: matic-cli - name: Create .env file + working-directory: matic-cli run: | - cd matic-cli cp .env.example .env sed -i 's,YOUR_IDENTIFIER,matic-cli-ci,' .env sed -i 's,aws-key,matic-cli-ci-key,' .env @@ -70,8 +67,8 @@ jobs: uses: haythem/public-ip@v1.3 - name: Create secret.tfvars + working-directory: matic-cli run: | - cd matic-cli touch secret.tfvars echo "SG_CIDR_BLOCKS=[\"${{ steps.ip.outputs.ipv4 }}/32\"]" >> secret.tfvars @@ -83,8 +80,8 @@ jobs: role-session-name: GithubActionsSession - name: Create aws key pair + working-directory: matic-cli run: | - cd matic-cli mkdir aws cd aws aws ec2 create-key-pair --key-name matic-cli-ci-key --key-type rsa --key-format pem --query "KeyMaterial" --output text > matic-cli-ci-key.pem @@ -96,30 +93,28 @@ jobs: node-version: '16.17.1' - name: Install npm dependencies - run: | - cd matic-cli - npm install --prefer-offline --no-audit --progress=false + working-directory: matic-cli + run: npm install --prefer-offline --no-audit --progress=false - name: Init devnet - run: | - cd matic-cli - ./bin/express-cli --init aws + working-directory: matic-cli + run: ./bin/express-cli --init aws - name: Start devnet + working-directory: matic-cli/deployments/devnet-1 run: | - cd matic-cli/deployments/devnet-1 ls -la ../../bin/express-cli --start - name: Run stateSynced and checkpoint tests + working-directory: matic-cli/deployments/devnet-1 run: | - cd matic-cli/deployments/devnet-1 ../../bin/express-cli --send-state-sync timeout 20m ../../bin/express-cli --monitor exit - name: Run smart contracts events tests + working-directory: matic-cli/deployments/devnet-1 run: | - cd matic-cli/deployments/devnet-1 timeout 5m ../../bin/express-cli --send-staked-event 1 timeout 5m ../../bin/express-cli --send-stakeupdate-event 1 timeout 5m ../../bin/express-cli --send-topupfee-event 1 @@ -127,13 +122,12 @@ jobs: - name: Destroy devnet if: always() + working-directory: matic-cli/deployments/devnet-1 run: | - cd matic-cli/deployments/devnet-1 echo "Running --destroy" ../../bin/express-cli --destroy - name: Delete aws key pair if: always() - run: | - cd matic-cli/aws - aws ec2 delete-key-pair --key-name matic-cli-ci-key + working-directory: matic-cli/aws + run: aws ec2 delete-key-pair --key-name matic-cli-ci-key