From 050c159a7aa120086809b0978b007dabba051848 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 1 Jun 2022 15:09:53 +0100 Subject: [PATCH] Update workflows. --- .../build-test-macos-wallet-did_wallet.yml | 11 +- .../build-test-macos-wallet-nft_wallet.yml | 12 +- .../build-test-ubuntu-wallet-did_wallet.yml | 11 +- .../build-test-ubuntu-wallet-nft_wallet.yml | 12 +- .../build-test-windows-wallet-did_wallet.yml | 27 +++- .../build-test-windows-wallet-nft_wallet.yml | 129 ++++++++++++++++++ 6 files changed, 191 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build-test-windows-wallet-nft_wallet.yml diff --git a/.github/workflows/build-test-macos-wallet-did_wallet.yml b/.github/workflows/build-test-macos-wallet-did_wallet.yml index 381bea6e02af..4e79b94a85d3 100644 --- a/.github/workflows/build-test-macos-wallet-did_wallet.yml +++ b/.github/workflows/build-test-macos-wallet-did_wallet.yml @@ -77,13 +77,20 @@ jobs: ${{ github.workspace }}/.chia/test-plots key: 0.29.0 - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' + - name: Checkout test blocks and plots (Linux, macOS) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'macos')) run: | wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - mkdir ${{ github.workspace }}/.chia mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Checkout test blocks and plots (Windows) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && startswith(matrix.os, 'windows') + run: | + Invoke-WebRequest -OutFile blocks_and_plots.zip https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.zip; Expand-Archive blocks_and_plots.zip -DestinationPath . + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Run install script env: INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} diff --git a/.github/workflows/build-test-macos-wallet-nft_wallet.yml b/.github/workflows/build-test-macos-wallet-nft_wallet.yml index 85b57e8eecf4..b98906ca5727 100644 --- a/.github/workflows/build-test-macos-wallet-nft_wallet.yml +++ b/.github/workflows/build-test-macos-wallet-nft_wallet.yml @@ -23,6 +23,7 @@ concurrency: jobs: build: name: MacOS wallet-nft_wallet Tests + if: true runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: @@ -76,13 +77,20 @@ jobs: ${{ github.workspace }}/.chia/test-plots key: 0.29.0 - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' + - name: Checkout test blocks and plots (Linux, macOS) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'macos')) run: | wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - mkdir ${{ github.workspace }}/.chia mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Checkout test blocks and plots (Windows) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && startswith(matrix.os, 'windows') + run: | + Invoke-WebRequest -OutFile blocks_and_plots.zip https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.zip; Expand-Archive blocks_and_plots.zip -DestinationPath . + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Run install script env: INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} diff --git a/.github/workflows/build-test-ubuntu-wallet-did_wallet.yml b/.github/workflows/build-test-ubuntu-wallet-did_wallet.yml index 326dd0c06ddb..74eaec74b2d7 100644 --- a/.github/workflows/build-test-ubuntu-wallet-did_wallet.yml +++ b/.github/workflows/build-test-ubuntu-wallet-did_wallet.yml @@ -77,13 +77,20 @@ jobs: ${{ github.workspace }}/.chia/test-plots key: 0.29.0 - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' + - name: Checkout test blocks and plots (Linux, macOS) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'macos')) run: | wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - mkdir ${{ github.workspace }}/.chia mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Checkout test blocks and plots (Windows) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && startswith(matrix.os, 'windows') + run: | + Invoke-WebRequest -OutFile blocks_and_plots.zip https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.zip; Expand-Archive blocks_and_plots.zip -DestinationPath . + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Run install script env: INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} diff --git a/.github/workflows/build-test-ubuntu-wallet-nft_wallet.yml b/.github/workflows/build-test-ubuntu-wallet-nft_wallet.yml index ac6138078d75..0d64ebd2a065 100644 --- a/.github/workflows/build-test-ubuntu-wallet-nft_wallet.yml +++ b/.github/workflows/build-test-ubuntu-wallet-nft_wallet.yml @@ -23,6 +23,7 @@ concurrency: jobs: build: name: Ubuntu wallet-nft_wallet Test + if: true runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: @@ -76,13 +77,20 @@ jobs: ${{ github.workspace }}/.chia/test-plots key: 0.29.0 - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' + - name: Checkout test blocks and plots (Linux, macOS) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'macos')) run: | wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - mkdir ${{ github.workspace }}/.chia mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Checkout test blocks and plots (Windows) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && startswith(matrix.os, 'windows') + run: | + Invoke-WebRequest -OutFile blocks_and_plots.zip https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.zip; Expand-Archive blocks_and_plots.zip -DestinationPath . + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + - name: Run install script env: INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} diff --git a/.github/workflows/build-test-windows-wallet-did_wallet.yml b/.github/workflows/build-test-windows-wallet-did_wallet.yml index 316280a7abcd..2ce07c50f2dd 100644 --- a/.github/workflows/build-test-windows-wallet-did_wallet.yml +++ b/.github/workflows/build-test-windows-wallet-did_wallet.yml @@ -25,7 +25,7 @@ jobs: name: Windows wallet-did_wallet Test if: true runs-on: ${{ matrix.os }} - timeout-minutes: 30 + timeout-minutes: 50 strategy: fail-fast: false max-parallel: 4 @@ -72,7 +72,28 @@ jobs: restore-keys: | ${{ runner.os }}-pip- -# Omitted checking out blocks and plots repo Chia-Network/test-cache + - name: Cache test blocks and plots + uses: actions/cache@v2 + id: test-blocks-plots + with: + path: | + ${{ github.workspace }}/.chia/blocks + ${{ github.workspace }}/.chia/test-plots + key: 0.29.0 + + - name: Checkout test blocks and plots (Linux, macOS) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'macos')) + run: | + wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + + - name: Checkout test blocks and plots (Windows) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && startswith(matrix.os, 'windows') + run: | + Invoke-WebRequest -OutFile blocks_and_plots.zip https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.zip; Expand-Archive blocks_and_plots.zip -DestinationPath . + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - name: Run install script env: @@ -85,7 +106,7 @@ jobs: - name: Test wallet-did_wallet code with pytest run: | ./venv/Scripts/activate.ps1 - venv/Scripts/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/did_wallet/test_did.py tests/wallet/did_wallet/test_did_rpc.py + venv/Scripts/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/did_wallet/test_did.py - name: Process coverage data run: | diff --git a/.github/workflows/build-test-windows-wallet-nft_wallet.yml b/.github/workflows/build-test-windows-wallet-nft_wallet.yml new file mode 100644 index 000000000000..d78db0da7920 --- /dev/null +++ b/.github/workflows/build-test-windows-wallet-nft_wallet.yml @@ -0,0 +1,129 @@ +# +# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme +# +name: Windows wallet-nft_wallet Test + +on: + push: + branches: + - 'long_lived/**' + - main + - 'release/**' + tags: + - '**' + pull_request: + branches: + - '**' + +concurrency: + # SHA is added to the end if on `main` to let all main workflows run + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }} + cancel-in-progress: true + +jobs: + build: + name: Windows wallet-nft_wallet Test + if: true + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + max-parallel: 4 + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10'] + os: [windows-latest] + env: + CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet + JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-nft_wallet + + steps: + - name: Configure git + run: | + git config --global core.autocrlf false + + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Python environment + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache npm + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache pip + uses: actions/cache@v3 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Cache test blocks and plots + uses: actions/cache@v2 + id: test-blocks-plots + with: + path: | + ${{ github.workspace }}/.chia/blocks + ${{ github.workspace }}/.chia/test-plots + key: 0.29.0 + + - name: Checkout test blocks and plots (Linux, macOS) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'macos')) + run: | + wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + + - name: Checkout test blocks and plots (Windows) + if: steps.test-blocks-plots.outputs.cache-hit != 'true' && startswith(matrix.os, 'windows') + run: | + Invoke-WebRequest -OutFile blocks_and_plots.zip https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.zip; Expand-Archive blocks_and_plots.zip -DestinationPath . + mkdir ${{ github.workspace }}/.chia + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + + - name: Run install script + env: + INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} + run: | + ./Install.ps1 -d + +# Omitted installing Timelord + + - name: Test wallet-nft_wallet code with pytest + run: | + ./venv/Scripts/activate.ps1 + venv/Scripts/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/nft_wallet/test_nft_clvm.py tests/wallet/nft_wallet/test_nft_wallet.py + + - name: Process coverage data + run: | + venv/Scripts/coverage combine --rcfile=.coveragerc + venv/Scripts/coverage xml --rcfile=.coveragerc -o coverage.xml + mkdir coverage_reports + cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" + cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" + venv/Scripts/coverage report --rcfile=.coveragerc --show-missing + + - name: Publish coverage + uses: actions/upload-artifact@v3 + with: + name: coverage + path: coverage_reports/* + if-no-files-found: error + +# +# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme +#