Skip to content

update yml file

update yml file #38

name: Run Full Regression Test
on:
push:
branches: [ "add-workflow-2" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Check Out Repository Code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Fork Sepolia
run: |
anvil --fork-url https://sepolia.infura.io/v3/2f7bda55539a457686c696e9b3be21f1 &
- name: Install Dependencies
run: |
npm install
- name: 'Create env file'
run: |
touch .env
echo WALLET_PRIVATE_KEY_A = ${{ secrets.WALLET_PRIVATE_KEY_A }} >> .env
echo WALLET_PRIVATE_KEY_B = ${{ secrets.WALLET_PRIVATE_KEY_B }} >> .env
echo WALLET_PRIVATE_KEY_C = ${{ secrets.WALLET_PRIVATE_KEY_C }} >> .env
echo SEPOLIA_MINTING_FEE_TOKEN = ${{ secrets.SEPOLIA_MINTING_FEE_TOKEN }} >> .env
echo SEPOLIA_RPC_PROVIDER_URL = http://localhost:8545 >> .env
echo SEPOLIA_MOCK_ERC721_ADDRESS = ${{ vars.SEPOLIA_NFT_CONTRACT_ADDRESS }} >> .env
echo SEPOLIA_LICENSING_MODULE_ADDRESS = ${{ vars.SEPOLIA_LICENSING_MODULE_ADDRESS }} >> .env
echo SEPOLIA_ROYALTY_POLICY_LAP_ADDRESS = ${{ vars.SEPOLIA_ROYALTY_POLICY_LAP_ADDRESS }} >> .env
echo SEPOLIA_DISPUTE_MODULE_ADDRESS = ${{ vars.SEPOLIA_DISPUTE_MODULE_ADDRESS }} >> .env
echo SEPOLIA_IPASSET_REGISTRY_ADDRESS = ${{ vars.SEPOLIA_IPASSET_REGISTRY_ADDRESS }} >> .env
echo SEPOLIA_LICENSE_TOKEN_ADDRESS = ${{ vars.SEPOLIA_LICENSE_TOKEN_ADDRESS }} >> .env
- name: Run E2E Test in Sepolia
run: |
npm run test:sepolia
- name: Upload Test Report
uses: actions/upload-artifact@v4
with:
name: sdk-sepolia-test-report
path: |
./test-reports
if: always()
- name: Get test report name
id: get-report-name
run: |
REPORT_PATH=$(ls ./test-results/*.html)
REPORT_NAME=$(basename "$REPORT_PATH")
echo "Report name: $REPORT_NAME"
echo "::set-output name=report_name::$REPORT_NAME"
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./test-reports
publish_branch: gh-pages
- name: Push Slack Notification
uses: slackapi/[email protected]
with:
channel-id: "C05HPKKNDCN"
payload: |
{
"text": "${{ github.repository }}: API Integration Tests have been completed. Check the results at https://jacqueline-57b.github.io/${{ github.repository }}/${{ steps.get-report-name.outputs.report_name }}",
"blocks": [
{ "type": "divider" },
{
"type": "image",
"title": {
"type": "plain_text",
"text": "SDK Regression Test Results"
},
"image_url": "http://www.quickmeme.com/img/b9/b9848df257b95cd39585368475a4b4e4a3a8c774f7390226daecb79b912087ad.jpg",
"alt_text": "SDK Regression Test Results"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text":"${{ github.repository }}: SDK Regression Test Result have been completed. \nCheck the results at https://jacqueline-57b.github.io/${{ github.repository }}/${{ steps.get-report-name.outputs.report_name }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}