|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| 3 | + |
| 4 | +name: fiber test action |
| 5 | +on: |
| 6 | + workflow_dispatch: # Allows the workflow to be manually triggered |
| 7 | + inputs: |
| 8 | + GitUrl: |
| 9 | + description: 'fiber -git url' |
| 10 | + default: 'https://github.com/nervosnetwork/fiber.git' |
| 11 | + GitBranch: |
| 12 | + description: 'fiber -git branch' |
| 13 | + default: 'develop' |
| 14 | + |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + |
| 19 | +jobs: |
| 20 | + prepare: |
| 21 | + runs-on: ubuntu-22.04 |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v3 |
| 25 | + - name: Set up Python 3.10 |
| 26 | + uses: actions/setup-python@v3 |
| 27 | + with: |
| 28 | + python-version: "3.10" |
| 29 | + |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + python -m pip install --upgrade pip |
| 33 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 34 | +
|
| 35 | + - name: Run make prepare |
| 36 | + run: make prepare |
| 37 | + env: |
| 38 | + GitUrl: '${{ github.event.inputs.GitUrl }}' |
| 39 | + GitBranch: '${{ github.event.inputs.GitBranch }}' |
| 40 | + |
| 41 | + - name: Tar backup |
| 42 | + run: | |
| 43 | + tar -czf prepare-backup.tar.gz \ |
| 44 | + download \ |
| 45 | + source/ckb-cli \ |
| 46 | + source/ckb-cli-old |
| 47 | +
|
| 48 | + - name: Backup data |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: prepare-backup-${{ runner.os }} |
| 52 | + path: prepare-backup.tar.gz |
| 53 | + |
| 54 | + fiber_test_open_channel: |
| 55 | + needs: prepare |
| 56 | + runs-on: ubuntu-22.04 |
| 57 | + |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v3 |
| 60 | + - name: Set up Python 3.10 |
| 61 | + uses: actions/setup-python@v3 |
| 62 | + with: |
| 63 | + python-version: "3.10" |
| 64 | + |
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + python -m pip install --upgrade pip |
| 68 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 69 | +
|
| 70 | + - name: Download prepare backup |
| 71 | + uses: actions/download-artifact@v4 |
| 72 | + with: |
| 73 | + name: prepare-backup-${{ runner.os }} |
| 74 | + path: ./ |
| 75 | + |
| 76 | + - name: Extract tarball and restore permissions |
| 77 | + run: | |
| 78 | + tar -xzf prepare-backup.tar.gz |
| 79 | +
|
| 80 | + - name: Run fiber_test_demo |
| 81 | + run: make fiber_test_demo FIBER_TEST_DEMO=test_cases/fiber/devnet/open_channel |
| 82 | + |
| 83 | + - name: Publish reports |
| 84 | + if: failure() |
| 85 | + uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + name: jfoa-open_channel-reports-${{ runner.os }} |
| 88 | + path: ./report |
| 89 | + |
| 90 | + fiber_test_accept_channel_cancel_invoice_connect_peer_disconnect_peer: |
| 91 | + needs: prepare |
| 92 | + runs-on: ubuntu-22.04 |
| 93 | + |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@v3 |
| 96 | + - name: Set up Python 3.10 |
| 97 | + uses: actions/setup-python@v3 |
| 98 | + with: |
| 99 | + python-version: "3.10" |
| 100 | + |
| 101 | + - name: Install dependencies |
| 102 | + run: | |
| 103 | + python -m pip install --upgrade pip |
| 104 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 105 | +
|
| 106 | + - name: Download prepare backup |
| 107 | + uses: actions/download-artifact@v4 |
| 108 | + with: |
| 109 | + name: prepare-backup-${{ runner.os }} |
| 110 | + path: ./ |
| 111 | + |
| 112 | + - name: Extract tarball and restore permissions |
| 113 | + run: | |
| 114 | + tar -xzf prepare-backup.tar.gz |
| 115 | +
|
| 116 | + - name: Run fiber_test_demo |
| 117 | + run: make fiber_test_demo FIBER_TEST_DEMO="test_cases/fiber/devnet/accept_channel test_cases/fiber/devnet/cancel_invoice test_cases/fiber/devnet/connect_peer test_cases/fiber/devnet/disconnect_peer" |
| 118 | + |
| 119 | + - name: Publish reports |
| 120 | + if: failure() |
| 121 | + uses: actions/upload-artifact@v4 |
| 122 | + with: |
| 123 | + name: jfoa-accept_channel_to_disconnect_peer-reports-${{ runner.os }} |
| 124 | + path: ./report |
| 125 | + |
| 126 | + fiber_test_get_invoice_graph_channels_graph_nodes_list_channels_new_invoice: |
| 127 | + needs: prepare |
| 128 | + runs-on: ubuntu-22.04 |
| 129 | + |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v3 |
| 132 | + - name: Set up Python 3.10 |
| 133 | + uses: actions/setup-python@v3 |
| 134 | + with: |
| 135 | + python-version: "3.10" |
| 136 | + |
| 137 | + - name: Install dependencies |
| 138 | + run: | |
| 139 | + python -m pip install --upgrade pip |
| 140 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 141 | +
|
| 142 | + - name: Download prepare backup |
| 143 | + uses: actions/download-artifact@v4 |
| 144 | + with: |
| 145 | + name: prepare-backup-${{ runner.os }} |
| 146 | + path: ./ |
| 147 | + |
| 148 | + - name: Extract tarball and restore permissions |
| 149 | + run: | |
| 150 | + tar -xzf prepare-backup.tar.gz |
| 151 | +
|
| 152 | + - name: Run fiber_test_demo |
| 153 | + run: make fiber_test_demo FIBER_TEST_DEMO="test_cases/fiber/devnet/get_invoice test_cases/fiber/devnet/graph_channels test_cases/fiber/devnet/graph_nodes test_cases/fiber/devnet/list_channels test_cases/fiber/devnet/new_invoice" |
| 154 | + |
| 155 | + - name: Publish reports |
| 156 | + if: failure() |
| 157 | + uses: actions/upload-artifact@v4 |
| 158 | + with: |
| 159 | + name: jfoa-accept_channel_to_disconnect_peer-reports-${{ runner.os }} |
| 160 | + path: ./report |
| 161 | + |
| 162 | + fiber_test_send_payment_module_offline: |
| 163 | + needs: prepare |
| 164 | + runs-on: ubuntu-22.04 |
| 165 | + |
| 166 | + steps: |
| 167 | + - uses: actions/checkout@v3 |
| 168 | + - name: Set up Python 3.10 |
| 169 | + uses: actions/setup-python@v3 |
| 170 | + with: |
| 171 | + python-version: "3.10" |
| 172 | + |
| 173 | + - name: Install dependencies |
| 174 | + run: | |
| 175 | + python -m pip install --upgrade pip |
| 176 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 177 | +
|
| 178 | + - name: Download prepare backup |
| 179 | + uses: actions/download-artifact@v4 |
| 180 | + with: |
| 181 | + name: prepare-backup-${{ runner.os }} |
| 182 | + path: ./ |
| 183 | + |
| 184 | + - name: Extract tarball and restore permissions |
| 185 | + run: | |
| 186 | + tar -xzf prepare-backup.tar.gz |
| 187 | +
|
| 188 | + - name: Run fiber_test_demo |
| 189 | + run: make fiber_test_demo FIBER_TEST_DEMO="test_cases/fiber/devnet/send_payment/module test_cases/fiber/devnet/send_payment/offline" |
| 190 | + |
| 191 | + - name: Publish reports |
| 192 | + if: failure() |
| 193 | + uses: actions/upload-artifact@v4 |
| 194 | + with: |
| 195 | + name: jfoa-send_payment-module-offline-reports-${{ runner.os }} |
| 196 | + path: ./report |
| 197 | + |
| 198 | + fiber_test_send_payment_params_path: |
| 199 | + needs: prepare |
| 200 | + runs-on: ubuntu-22.04 |
| 201 | + |
| 202 | + steps: |
| 203 | + - uses: actions/checkout@v3 |
| 204 | + - name: Set up Python 3.10 |
| 205 | + uses: actions/setup-python@v3 |
| 206 | + with: |
| 207 | + python-version: "3.10" |
| 208 | + |
| 209 | + - name: Install dependencies |
| 210 | + run: | |
| 211 | + python -m pip install --upgrade pip |
| 212 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 213 | +
|
| 214 | + - name: Download prepare backup |
| 215 | + uses: actions/download-artifact@v4 |
| 216 | + with: |
| 217 | + name: prepare-backup-${{ runner.os }} |
| 218 | + path: ./ |
| 219 | + |
| 220 | + - name: Extract tarball and restore permissions |
| 221 | + run: | |
| 222 | + tar -xzf prepare-backup.tar.gz |
| 223 | +
|
| 224 | + - name: Run fiber_test_demo |
| 225 | + run: make fiber_test_demo FIBER_TEST_DEMO="test_cases/fiber/devnet/send_payment/params test_cases/fiber/devnet/send_payment/path" |
| 226 | + |
| 227 | + - name: Publish reports |
| 228 | + if: failure() |
| 229 | + uses: actions/upload-artifact@v4 |
| 230 | + with: |
| 231 | + name: jfoa-send_payment-params-path-reports-${{ runner.os }} |
| 232 | + path: ./report |
| 233 | + |
| 234 | + |
| 235 | + fiber_test_shutdown_channel_update_channel_issue: |
| 236 | + needs: prepare |
| 237 | + runs-on: ubuntu-22.04 |
| 238 | + |
| 239 | + steps: |
| 240 | + - uses: actions/checkout@v3 |
| 241 | + - name: Set up Python 3.10 |
| 242 | + uses: actions/setup-python@v3 |
| 243 | + with: |
| 244 | + python-version: "3.10" |
| 245 | + |
| 246 | + - name: Install dependencies |
| 247 | + run: | |
| 248 | + python -m pip install --upgrade pip |
| 249 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 250 | +
|
| 251 | + - name: Download prepare backup |
| 252 | + uses: actions/download-artifact@v4 |
| 253 | + with: |
| 254 | + name: prepare-backup-${{ runner.os }} |
| 255 | + path: ./ |
| 256 | + |
| 257 | + - name: Extract tarball and restore permissions |
| 258 | + run: | |
| 259 | + tar -xzf prepare-backup.tar.gz |
| 260 | +
|
| 261 | + - name: Run fiber_test_demo |
| 262 | + run: make fiber_test_demo FIBER_TEST_DEMO="test_cases/fiber/devnet/shutdown_channel test_cases/fiber/devnet/update_channel test_cases/fiber/devnet/issue" |
| 263 | + |
| 264 | + - name: Publish reports |
| 265 | + if: failure() |
| 266 | + uses: actions/upload-artifact@v4 |
| 267 | + with: |
| 268 | + name: jfoa-send_payment-reports-${{ runner.os }} |
| 269 | + path: ./report |
| 270 | + |
| 271 | + |
| 272 | + fiber_test_watch_tower: |
| 273 | + needs: prepare |
| 274 | + runs-on: ubuntu-22.04 |
| 275 | + |
| 276 | + steps: |
| 277 | + - uses: actions/checkout@v3 |
| 278 | + - name: Set up Python 3.10 |
| 279 | + uses: actions/setup-python@v3 |
| 280 | + with: |
| 281 | + python-version: "3.10" |
| 282 | + |
| 283 | + - name: Install dependencies |
| 284 | + run: | |
| 285 | + python -m pip install --upgrade pip |
| 286 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 287 | +
|
| 288 | + - name: Download prepare backup |
| 289 | + uses: actions/download-artifact@v4 |
| 290 | + with: |
| 291 | + name: prepare-backup-${{ runner.os }} |
| 292 | + path: ./ |
| 293 | + |
| 294 | + - name: Extract tarball and restore permissions |
| 295 | + run: | |
| 296 | + tar -xzf prepare-backup.tar.gz |
| 297 | +
|
| 298 | + - name: Run fiber_test_demo |
| 299 | + run: make fiber_test_demo FIBER_TEST_DEMO="test_cases/fiber/devnet/watch_tower" |
| 300 | + - name: Publish reports |
| 301 | + if: failure() |
| 302 | + uses: actions/upload-artifact@v4 |
| 303 | + with: |
| 304 | + name: jfoa-watch_tower-reports-${{ runner.os }} |
| 305 | + path: ./report |
| 306 | + |
| 307 | + |
| 308 | + fiber_test_watch_tower_tlc: |
| 309 | + needs: prepare |
| 310 | + runs-on: ubuntu-22.04 |
| 311 | + |
| 312 | + steps: |
| 313 | + - uses: actions/checkout@v3 |
| 314 | + - name: Set up Python 3.10 |
| 315 | + uses: actions/setup-python@v3 |
| 316 | + with: |
| 317 | + python-version: "3.10" |
| 318 | + |
| 319 | + - name: Install dependencies |
| 320 | + run: | |
| 321 | + python -m pip install --upgrade pip |
| 322 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 323 | +
|
| 324 | + - name: Download prepare backup |
| 325 | + uses: actions/download-artifact@v4 |
| 326 | + with: |
| 327 | + name: prepare-backup-${{ runner.os }} |
| 328 | + path: ./ |
| 329 | + |
| 330 | + - name: Extract tarball and restore permissions |
| 331 | + run: | |
| 332 | + tar -xzf prepare-backup.tar.gz |
| 333 | +
|
| 334 | + - name: Run fiber_test_demo |
| 335 | + run: make fiber_test_demo FIBER_TEST_DEMO="test_cases/fiber/devnet/watch_tower_wit_tlc" |
| 336 | + - name: Publish reports |
| 337 | + if: failure() |
| 338 | + uses: actions/upload-artifact@v4 |
| 339 | + with: |
| 340 | + name: jfoa-watch_tower-reports-${{ runner.os }} |
| 341 | + path: ./report |
0 commit comments