forked from storyprotocol/sdk-e2e-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (75 loc) · 2.8 KB
/
run-e2e-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Run E2E 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:e2e
- name: Upload Test Report
uses: actions/upload-artifact@v4
with:
name: sdk-sepolia-test-report
path: |
./test-reports
if: always()
- name: Copy report to date folder
id: create_folder
run: |
folder_name=$(date +%Y%m%d)
echo "Folder name: $folder_name"
mkdir -p ./tmp/$folder_name
cp -R ./test-reports/* ./tmp/$folder_name
echo "::set-output name=folder_name::$folder_name"
- name: test
id: echo-echo-echo
run: |
echo ${{ steps.create_folder.outputs.folder_name }}
cd ./tmp/${{ steps.create_folder.outputs.folder_name }}
ls -al
# Deploy report to GitHub Pages
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tmp
publish_branch: gh-pages
keep_files: true