Workflow file for this run
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: "ETH Cyrograf: Deploy contract to testnet" | |
on: | |
workflow_dispatch: {} | |
pull_request: | |
branches: [ master ] | |
paths: [ 'eth/**' ] | |
types: [ closed ] | |
jobs: | |
deploy: | |
name: ETH Deploy | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: ETH Deploy | |
uses: piotrjwegrzyn/evm-deployment@v2.2.4 | |
with: | |
contract-name: 'Cyrograf' | |
contract-filename: 'cyrograf' | |
contract-connector: 'sc_connector' | |
parent-dir: 'eth/' | |
deployer-pk: ${{ secrets.DEPLOYER_PK }} | |
rpc-url: ${{ secrets.RPC_ETH_SEPOLIA_HTTPS }} | |
integration_test: | |
name: ETH integration tests | |
needs: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Environment Setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- name: Install dependencies | |
run: npm install web3 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sc_connector.json | |
- name: Run tests | |
env: | |
RPC_URL: ${{ secrets.RPC_ETH_SEPOLIA_HTTPS }} | |
ACCOUNT_ADDRESS: ${{ secrets.DEPLOYER_ADDRESS }} | |
PRIVATE_KEY: ${{ secrets.DEPLOYER_PK }} | |
run: | | |
echo "old connector:\n\n" | |
cat integration/sc_connector.json | |
rm integration/sc_connector.json | |
cp sc_connector.json integration/sc_connector.json | |
echo "new connector:\n\n" | |
cat integration/sc_connector.json | |
node --no-deprecation integration/tester.js | |
shell: bash | |
connector_updater: | |
name: ETH connector PR | |
needs: integration_test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create new branch | |
run: | | |
branch_name=new-connector-$(eval "date +%y%m%d-%H%M%S") | |
git checkout -b ${branch_name} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sc_connector.json | |
- name: Update files | |
run: | | |
cp sc_connector.json ui/ | |
cp sc_connector.json integration/ | |
- name: Commit changes | |
run: | | |
git config --global user.email "${{ env.CI_COMMIT_AUTHOR }}" | |
git config --global user.name "github-actions[bot]" | |
git add ui/ integration/ | |
git commit -m "${branch_name}" | |
- name: Push changes | |
run: | | |
git push origin ${branch_name} | |
- name: Create pull request | |
run: gh pr create -B master -H ${branch_name} --title 'Merge ${branch_name} into base_branch' --body 'Created by GitHub Action' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |