From 53bea25d4e5d6dd06062b5cd9572012108cf06b6 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Wed, 3 Apr 2024 13:57:52 -0400 Subject: [PATCH] [CI] Make more tests run on every commit --- ...omment_trigger_test_itensorgaussianmps.yml | 82 ----------------- .../comment_trigger_test_itensors_mps.yml | 87 ------------------- ...mment_trigger_test_itensorunicodeplots.yml | 83 ------------------ ...ment_trigger_test_itensorvisualization.yml | 82 ----------------- ...yml => test_itensorgaussianmps_ubuntu.yml} | 7 +- ...ors_mps.yml => test_itensormps_ubuntu.yml} | 4 +- .../workflows/test_itensors_base_ubuntu.yml | 1 + ...ml => test_itensorunicodeplots_ubuntu.yml} | 7 +- ...l => test_itensorvisualization_ubuntu.yml} | 7 +- 9 files changed, 22 insertions(+), 338 deletions(-) delete mode 100644 .github/workflows/comment_trigger_test_itensorgaussianmps.yml delete mode 100644 .github/workflows/comment_trigger_test_itensors_mps.yml delete mode 100644 .github/workflows/comment_trigger_test_itensorunicodeplots.yml delete mode 100644 .github/workflows/comment_trigger_test_itensorvisualization.yml rename .github/workflows/{main_test_itensorgaussianmps.yml => test_itensorgaussianmps_ubuntu.yml} (85%) rename .github/workflows/{main_test_itensors_mps.yml => test_itensormps_ubuntu.yml} (95%) rename .github/workflows/{main_test_itensorunicodeplots.yml => test_itensorunicodeplots_ubuntu.yml} (85%) rename .github/workflows/{main_test_itensorvisualization.yml => test_itensorvisualization_ubuntu.yml} (84%) diff --git a/.github/workflows/comment_trigger_test_itensorgaussianmps.yml b/.github/workflows/comment_trigger_test_itensorgaussianmps.yml deleted file mode 100644 index cfce1fd5f4..0000000000 --- a/.github/workflows/comment_trigger_test_itensorgaussianmps.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Run ITensorGaussianMPS tests from comment trigger - -# https://dev.to/zirkelc/trigger-github-workflow-for-comment-on-pull-request-45l2 - -on: - issue_comment: - types: [created] - -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.threads }} thread(s) - if: github.event.issue.pull_request && contains(github.event.comment.body, '[test ITensorGaussianMPS]') - runs-on: ${{ matrix.os }} - env: - JULIA_NUM_THREADS: ${{ matrix.threads }} - strategy: - matrix: - version: - - '1.6' - - '1' - os: - - ubuntu-latest - threads: - - '2' - arch: - - x64 - steps: - - name: Get PR branch - uses: xt0rted/pull-request-comment-branch@v1 - id: comment-branch - - name: Set latest commit status as pending - uses: myrotvorets/set-commit-status-action@master - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: pending - - name: Checkout PR branch - uses: actions/checkout@v3 - with: - # https://github.com/actions/checkout/issues/331#issuecomment-1438220926 - ref: refs/pull/${{ github.event.issue.number }}/head - - name: Setup Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - name: Install Julia dependencies - shell: julia --project=monorepo {0} - run: | - using Pkg; - Pkg.develop(path="."); - Pkg.develop(path="./NDTensors"); - Pkg.develop(path="./ITensorGaussianMPS"); - - name: Run the tests - run: | - julia --project=monorepo --depwarn=yes -e 'using Pkg; Pkg.test("ITensorGaussianMPS")' - - name: Set latest commit status as ${{ job.status }} - uses: myrotvorets/set-commit-status-action@master - if: always() - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - - name: Add comment to PR - uses: actions/github-script@v6 - if: always() - with: - script: | - const name = '${{ github.workflow }}'; - const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; - const success = '${{ job.status }}' === 'success'; - const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }) diff --git a/.github/workflows/comment_trigger_test_itensors_mps.yml b/.github/workflows/comment_trigger_test_itensors_mps.yml deleted file mode 100644 index ca2fbf2fb7..0000000000 --- a/.github/workflows/comment_trigger_test_itensors_mps.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Run ITensorMPS tests from comment trigger - -# https://dev.to/zirkelc/trigger-github-workflow-for-comment-on-pull-request-45l2 - -on: - issue_comment: - types: [created] - -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.threads }} thread(s) - if: github.event.issue.pull_request && contains(github.event.comment.body, '[test ITensorMPS]') - runs-on: ${{ matrix.os }} - env: - JULIA_NUM_THREADS: ${{ matrix.threads }} - strategy: - matrix: - version: - - '1.6' - - '1' - os: - - ubuntu-latest - threads: - - '2' - arch: - - x64 - steps: - - name: Get PR branch - uses: xt0rted/pull-request-comment-branch@v1 - id: comment-branch - - name: Set latest commit status as pending - uses: myrotvorets/set-commit-status-action@master - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: pending - - name: Checkout PR branch - uses: actions/checkout@v3 - with: - # https://github.com/actions/checkout/issues/331#issuecomment-1438220926 - ref: refs/pull/${{ github.event.issue.number }}/head - - name: Setup Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - name: Install Julia dependencies - shell: julia --project=monorepo {0} - run: | - using Pkg; - Pkg.develop(path="."); - Pkg.develop(path="./NDTensors"); - - name: Run the tests - shell: julia --project=monorepo {0} - run: | - using Pkg; - # https://github.com/JuliaLang/Pkg.jl/pull/1226 - Pkg.test("ITensors"; coverage=true, test_args=["mps"]) - - uses: julia-actions/julia-uploadcodecov@latest - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Set latest commit status as ${{ job.status }} - uses: myrotvorets/set-commit-status-action@master - if: always() - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - - name: Add comment to PR - uses: actions/github-script@v6 - if: always() - with: - script: | - const name = '${{ github.workflow }}'; - const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; - const success = '${{ job.status }}' === 'success'; - const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }) diff --git a/.github/workflows/comment_trigger_test_itensorunicodeplots.yml b/.github/workflows/comment_trigger_test_itensorunicodeplots.yml deleted file mode 100644 index 56b0cb96c7..0000000000 --- a/.github/workflows/comment_trigger_test_itensorunicodeplots.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Run ITensorUnicodePlots tests from comment trigger - -# https://dev.to/zirkelc/trigger-github-workflow-for-comment-on-pull-request-45l2 - -on: - issue_comment: - types: [created] - -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.threads }} thread(s) - if: github.event.issue.pull_request && contains(github.event.comment.body, '[test ITensorUnicodePlots]') - runs-on: ${{ matrix.os }} - env: - JULIA_NUM_THREADS: ${{ matrix.threads }} - strategy: - matrix: - version: - - '1.6' - - '1' - os: - - ubuntu-latest - threads: - - '2' - arch: - - x64 - steps: - - name: Get PR branch - uses: xt0rted/pull-request-comment-branch@v1 - id: comment-branch - - name: Set latest commit status as pending - uses: myrotvorets/set-commit-status-action@master - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: pending - - name: Checkout PR branch - uses: actions/checkout@v3 - with: - # https://github.com/actions/checkout/issues/331#issuecomment-1438220926 - ref: refs/pull/${{ github.event.issue.number }}/head - - name: Setup Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - name: Install Julia dependencies - shell: julia --project=monorepo {0} - run: | - using Pkg; - Pkg.develop(path="."); - Pkg.develop(path="./NDTensors"); - Pkg.develop(path="./ITensorVisualizationBase") - Pkg.develop(path="./ITensorUnicodePlots") - - name: Run the tests - run: | - julia --project=monorepo --depwarn=yes -e 'using Pkg; Pkg.test("ITensorUnicodePlots")' - - name: Set latest commit status as ${{ job.status }} - uses: myrotvorets/set-commit-status-action@master - if: always() - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - - name: Add comment to PR - uses: actions/github-script@v6 - if: always() - with: - script: | - const name = '${{ github.workflow }}'; - const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; - const success = '${{ job.status }}' === 'success'; - const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }) diff --git a/.github/workflows/comment_trigger_test_itensorvisualization.yml b/.github/workflows/comment_trigger_test_itensorvisualization.yml deleted file mode 100644 index 6297a67e9d..0000000000 --- a/.github/workflows/comment_trigger_test_itensorvisualization.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Run ITensorVisualizationBase tests from comment trigger - -# https://dev.to/zirkelc/trigger-github-workflow-for-comment-on-pull-request-45l2 - -on: - issue_comment: - types: [created] - -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.threads }} thread(s) - if: github.event.issue.pull_request && contains(github.event.comment.body, '[test ITensorVisualizationBase]') - runs-on: ${{ matrix.os }} - env: - JULIA_NUM_THREADS: ${{ matrix.threads }} - strategy: - matrix: - version: - - '1.6' - - '1' - os: - - ubuntu-latest - threads: - - '2' - arch: - - x64 - steps: - - name: Get PR branch - uses: xt0rted/pull-request-comment-branch@v1 - id: comment-branch - - name: Set latest commit status as pending - uses: myrotvorets/set-commit-status-action@master - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: pending - - name: Checkout PR branch - uses: actions/checkout@v3 - with: - # https://github.com/actions/checkout/issues/331#issuecomment-1438220926 - ref: refs/pull/${{ github.event.issue.number }}/head - - name: Setup Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - name: Install Julia dependencies - shell: julia --project=monorepo {0} - run: | - using Pkg; - Pkg.develop(path="."); - Pkg.develop(path="./NDTensors"); - Pkg.develop(path="./ITensorVisualizationBase"); - - name: Run the tests - run: | - julia --project=monorepo --depwarn=yes -e 'using Pkg; Pkg.test("ITensorVisualizationBase")' - - name: Set latest commit status as ${{ job.status }} - uses: myrotvorets/set-commit-status-action@master - if: always() - with: - sha: ${{ steps.comment-branch.outputs.head_sha }} - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - - name: Add comment to PR - uses: actions/github-script@v6 - if: always() - with: - script: | - const name = '${{ github.workflow }}'; - const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; - const success = '${{ job.status }}' === 'success'; - const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }) diff --git a/.github/workflows/main_test_itensorgaussianmps.yml b/.github/workflows/test_itensorgaussianmps_ubuntu.yml similarity index 85% rename from .github/workflows/main_test_itensorgaussianmps.yml rename to .github/workflows/test_itensorgaussianmps_ubuntu.yml index f631204542..ccc165f75d 100644 --- a/.github/workflows/main_test_itensorgaussianmps.yml +++ b/.github/workflows/test_itensorgaussianmps_ubuntu.yml @@ -1,9 +1,11 @@ -name: Run ITensorGaussianMPS tests on push to main +name: Run ITensorGaussianMPS tests (Ubuntu) on: push: branches: - main + tags: '*' + pull_request: jobs: test: @@ -22,6 +24,9 @@ jobs: - '1' arch: - x64 + exclude: + # MacOS not available on x86 + - {os: 'macOS-latest', arch: 'x86'} steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest diff --git a/.github/workflows/main_test_itensors_mps.yml b/.github/workflows/test_itensormps_ubuntu.yml similarity index 95% rename from .github/workflows/main_test_itensors_mps.yml rename to .github/workflows/test_itensormps_ubuntu.yml index 28b1819d25..6bd4faf238 100644 --- a/.github/workflows/main_test_itensors_mps.yml +++ b/.github/workflows/test_itensormps_ubuntu.yml @@ -1,9 +1,11 @@ -name: Run ITensors mps tests on push to main +name: Run ITensorMPS tests (Ubuntu) on: push: branches: - main + tags: '*' + pull_request: jobs: test: diff --git a/.github/workflows/test_itensors_base_ubuntu.yml b/.github/workflows/test_itensors_base_ubuntu.yml index 1314173bba..c991a2dd0b 100644 --- a/.github/workflows/test_itensors_base_ubuntu.yml +++ b/.github/workflows/test_itensors_base_ubuntu.yml @@ -43,6 +43,7 @@ jobs: shell: julia --project=monorepo {0} run: | using Pkg; + # https://github.com/JuliaLang/Pkg.jl/pull/1226 Pkg.test("ITensors"; coverage=true, test_args=["base"]) - uses: julia-actions/julia-uploadcodecov@latest env: diff --git a/.github/workflows/main_test_itensorunicodeplots.yml b/.github/workflows/test_itensorunicodeplots_ubuntu.yml similarity index 85% rename from .github/workflows/main_test_itensorunicodeplots.yml rename to .github/workflows/test_itensorunicodeplots_ubuntu.yml index a8b9d009dd..833b3026b3 100644 --- a/.github/workflows/main_test_itensorunicodeplots.yml +++ b/.github/workflows/test_itensorunicodeplots_ubuntu.yml @@ -1,9 +1,11 @@ -name: Run ITensorUnicodePlots tests on push to main +name: Run ITensorUnicodePlots tests (Ubuntu) on: push: branches: - main + tags: '*' + pull_request: jobs: test: @@ -22,6 +24,9 @@ jobs: - '1' arch: - x64 + exclude: + # MacOS not available on x86 + - {os: 'macOS-latest', arch: 'x86'} steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest diff --git a/.github/workflows/main_test_itensorvisualization.yml b/.github/workflows/test_itensorvisualization_ubuntu.yml similarity index 84% rename from .github/workflows/main_test_itensorvisualization.yml rename to .github/workflows/test_itensorvisualization_ubuntu.yml index ce415baa23..be6585c8cf 100644 --- a/.github/workflows/main_test_itensorvisualization.yml +++ b/.github/workflows/test_itensorvisualization_ubuntu.yml @@ -1,9 +1,11 @@ -name: Run ITensorVisualizationBase tests on push to main +name: Run ITensorVisualizationBase tests (Ubuntu) on: push: branches: - main + tags: '*' + pull_request: jobs: test: @@ -22,6 +24,9 @@ jobs: - '1' arch: - x64 + exclude: + # MacOS not available on x86 + - {os: 'macOS-latest', arch: 'x86'} steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest