From 566cb3b2f372c23b89dc0dd6fb2152e79d4c89bd Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 1 Nov 2023 15:13:06 -0700 Subject: [PATCH 1/6] Run tests nightly against chia-blockchain main --- .github/workflows/run-tests-nightly.yml | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/run-tests-nightly.yml diff --git a/.github/workflows/run-tests-nightly.yml b/.github/workflows/run-tests-nightly.yml new file mode 100644 index 0000000..3df0bbf --- /dev/null +++ b/.github/workflows/run-tests-nightly.yml @@ -0,0 +1,61 @@ +--- +name: Run Test Suite Nightly + +on: + workflow_dispatch: + schedule: + - cron: "30 11 * * *" + push: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os.runs-on }} + name: All tests + timeout-minutes: 30 + strategy: + max-parallel: 4 + fail-fast: false + matrix: + os: + - runs-on: macos-latest + - runs-on: ubuntu-latest + - runs-on: windows-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Python environment + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Setup simulator + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Test code with pytest against chia-blockchain main + shell: bash + run: | + python3 -m venv venv + if [[ ${{ matrix.os.runs-on }} == windows-latest ]]; then + source ./venv/Scripts/activate + else + . ./venv/bin/activate + fi + sed -i 's/chia-blockchain.*/chia-blockchain @ git+https:\/\/github.com\/Chia-Network\/chia-blockchain.git@main\",/g' setup.py + pip install --extra-index https://pypi.chia.net/simple/ --editable .[dev] + chia init + echo -ne "\n" | chia dev sim create + export CHIA_ROOT=~/.chia/simulator/main/ + chia start wallet + sleep 10 + chia wallet did create + pytest tests/test_mint.py From 1ca5a1f72243db5b3739b8b1633256946aac80d8 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 1 Nov 2023 15:14:40 -0700 Subject: [PATCH 2/6] Nightly only on Ubuntu --- .github/workflows/run-tests-nightly.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/run-tests-nightly.yml b/.github/workflows/run-tests-nightly.yml index 3df0bbf..a234b20 100644 --- a/.github/workflows/run-tests-nightly.yml +++ b/.github/workflows/run-tests-nightly.yml @@ -21,9 +21,7 @@ jobs: fail-fast: false matrix: os: - - runs-on: macos-latest - runs-on: ubuntu-latest - - runs-on: windows-latest steps: - name: Checkout Code From ff2084bd865c4f90794537d574202816b009f196 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 1 Nov 2023 15:18:20 -0700 Subject: [PATCH 3/6] Remove on push --- .github/workflows/run-tests-nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-tests-nightly.yml b/.github/workflows/run-tests-nightly.yml index a234b20..bed6eec 100644 --- a/.github/workflows/run-tests-nightly.yml +++ b/.github/workflows/run-tests-nightly.yml @@ -5,7 +5,6 @@ on: workflow_dispatch: schedule: - cron: "30 11 * * *" - push: concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} From 827bcec584a54692261bf5b35c9c1bbe88d578ef Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 1 Nov 2023 15:30:01 -0700 Subject: [PATCH 4/6] Address review - remove duplicate python setup and use v4 checkout action --- .github/workflows/run-tests-nightly.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/run-tests-nightly.yml b/.github/workflows/run-tests-nightly.yml index bed6eec..1314076 100644 --- a/.github/workflows/run-tests-nightly.yml +++ b/.github/workflows/run-tests-nightly.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -33,11 +33,6 @@ jobs: with: python-version: '3.10' - - name: Setup simulator - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Test code with pytest against chia-blockchain main shell: bash run: | From c55386f3faf30d643e54612beac481fc4ae52c89 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 1 Nov 2023 15:31:18 -0700 Subject: [PATCH 5/6] Add back on push to get a final test run --- .github/workflows/run-tests-nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-tests-nightly.yml b/.github/workflows/run-tests-nightly.yml index 1314076..c6f97c5 100644 --- a/.github/workflows/run-tests-nightly.yml +++ b/.github/workflows/run-tests-nightly.yml @@ -5,6 +5,7 @@ on: workflow_dispatch: schedule: - cron: "30 11 * * *" + push: concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} From 3ad8899204baea55be5a69dcd1306b4af48a9875 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 1 Nov 2023 15:37:42 -0700 Subject: [PATCH 6/6] Remove on push to be ready for merging --- .github/workflows/run-tests-nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-tests-nightly.yml b/.github/workflows/run-tests-nightly.yml index c6f97c5..1314076 100644 --- a/.github/workflows/run-tests-nightly.yml +++ b/.github/workflows/run-tests-nightly.yml @@ -5,7 +5,6 @@ on: workflow_dispatch: schedule: - cron: "30 11 * * *" - push: concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}