diff --git a/.github/workflows/fast_tests.yml b/.github/workflows/fast_tests.yml new file mode 100644 index 00000000000..11034cd9862 --- /dev/null +++ b/.github/workflows/fast_tests.yml @@ -0,0 +1,94 @@ +# For more information about TARDIS pipelines, please refer to: +# +# https://tardis-sn.github.io/tardis/development/continuous_integration.html + +name: fast tests + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + types: + - opened + - reopened + - synchronize + - labeled + + +env: + CACHE_NUMBER: 0 # increase to reset cache manually + PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data + --cov=tardis --cov-report=xml --cov-report=html + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + +defaults: + run: + shell: bash -l {0} + +jobs: + test-matrix: + runs-on: ubuntu-latest + steps: + - id: set-matrix + run: | + sudo apt-get install jq + echo 'folder-matrix=$(find "tardis" -mindepth 1 -maxdepth 1 -type d | grep -v '__pycache__' | jq -R . | jq -cs .)' >> "$GITHUB_OUTPUT" + echo 'os-matrix=["ubuntu-latest", "macos-latest"]' >> "$GITHUB_OUTPUT" + outputs: + folder-matrix: ${{ steps.set-matrix.outputs.folder-matrix }} + os-matrix: ${{ steps.set-matrix.outputs.os-matrix }} + + non-continuum: + needs: test-matrix + strategy: + matrix: + test-path: ${{fromJson(needs.test-matrix.outputs.folder-matrix)}} + os: ${{fromJson(needs.test-matrix.outputs.os-matrix)}} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - name: Setup tardis + uses: ./.github/actions/setup_tardis + with: + os-label: ${{ matrix.os=='macos-latest' && 'osx-arm64' || 'linux-64' }} + + - name: Install package editable + run: | + pip install -e . + + - name: Run tests + run: pytest ${{ matrix.test-path }} ${{ env.PYTEST_FLAGS }} -m "not continuum" + + - name: Refdata Generation tests + run: pytest ${{ matrix.test-path }} ${{ env.PYTEST_FLAGS }} --generate-reference + if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master' + + continuum_tests: + needs: test-matrix + strategy: + matrix: + test-path: ${{fromJson(needs.test-matrix.outputs.folder-matrix)}} + os: ${{fromJson(needs.test-matrix.outputs.os-matrix)}} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - name: Setup tardis + uses: ./.github/actions/setup_tardis + with: + os-label: ${{ matrix.os=='macos-latest' && 'osx-arm64' || 'linux-64' }} + + - name: Install package editable + run: | + pip install -e . + + - name: Run continuum tests + run: pytest ${{ matrix.test-path }} ${{ env.PYTEST_FLAGS }} -m continuum + + - name: Refdata Generation tests + run: pytest ${{ matrix.test-path }} ${{ env.PYTEST_FLAGS }} --generate-reference + if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce247523e08..7dba9224d3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,38 +1,38 @@ -name: main +# name: main -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' +# on: +# push: +# branches: +# - '*' +# pull_request: +# branches: +# - '*' -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true +# concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} +# cancel-in-progress: true -jobs: - matrix: - if: github.repository_owner == 'tardis-sn' - strategy: - # super important if you want to see all results, even if one fails - # fail-fast is true by default - fail-fast: false - matrix: - label: [osx-arm64, linux-64] - include: - - label: osx-arm64 - os: macos-latest - prefix: /Users/runner/miniconda3/envs/tardis +# jobs: +# matrix: +# if: github.repository_owner == 'tardis-sn' +# strategy: +# # super important if you want to see all results, even if one fails +# # fail-fast is true by default +# fail-fast: false +# matrix: +# label: [osx-arm64, linux-64] +# include: +# - label: osx-arm64 +# os: macos-latest +# prefix: /Users/runner/miniconda3/envs/tardis - - label: linux-64 - os: ubuntu-latest - prefix: /usr/share/miniconda3/envs/tardis +# - label: linux-64 +# os: ubuntu-latest +# prefix: /usr/share/miniconda3/envs/tardis - uses: ./.github/workflows/new_tests.yml - with: - run_label: ${{ matrix.label }} - run_os: ${{ matrix.os }} - secrets: inherit \ No newline at end of file +# uses: ./.github/workflows/new_tests.yml +# with: +# run_label: ${{ matrix.label }} +# run_os: ${{ matrix.os }} +# secrets: inherit \ No newline at end of file diff --git a/.github/workflows/new_tests.yml b/.github/workflows/new_tests.yml index 6d42f71ae12..3132b8bc73d 100644 --- a/.github/workflows/new_tests.yml +++ b/.github/workflows/new_tests.yml @@ -1,101 +1,101 @@ -# For more information about TARDIS pipelines, please refer to: -# -# https://tardis-sn.github.io/tardis/development/continuous_integration.html +# # For more information about TARDIS pipelines, please refer to: +# # +# # https://tardis-sn.github.io/tardis/development/continuous_integration.html -name: tests +# name: tests -on: - workflow_call: - inputs: - run_label: - required: true - type: string - run_os: - required: true - type: string +# on: +# workflow_call: +# inputs: +# run_label: +# required: true +# type: string +# run_os: +# required: true +# type: string - # push: - # branches: - # - '*' +# # push: +# # branches: +# # - '*' - # pull_request: - # branches: - # - '*' +# # pull_request: +# # branches: +# # - '*' - # types: - # - opened - # - reopened - # - synchronize - # - labeled +# # types: +# # - opened +# # - reopened +# # - synchronize +# # - labeled -env: - CACHE_NUMBER: 0 # increase to reset cache manually - PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data - --cov=tardis --cov-report=xml --cov-report=html - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +# env: +# CACHE_NUMBER: 0 # increase to reset cache manually +# PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data +# --cov=tardis --cov-report=xml --cov-report=html +# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} -defaults: - run: - shell: bash -l {0} +# defaults: +# run: +# shell: bash -l {0} -jobs: - base: - name: base-${{ inputs.run_label }} - runs-on: ${{ inputs.run_os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/upload-artifact@v4 - with: - name: tardis-repo-${{ inputs.run_label }} - path: ./ - retention-days: 1 +# jobs: +# test-matrix: +# name: base-${{ inputs.run_label }} +# runs-on: ${{ inputs.run_os }} +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/upload-artifact@v4 +# with: +# name: tardis-repo-${{ inputs.run_label }} +# path: ./ +# retention-days: 1 - non-continuum: - runs-on: ${{ inputs.run_os }} - needs: base - steps: - - uses: actions/download-artifact@v4 - with: - name: tardis-repo-${{ inputs.run_label }} - path: ./ +# non-continuum: +# runs-on: ${{ inputs.run_os }} +# needs: test-matrix +# steps: +# - uses: actions/download-artifact@v4 +# with: +# name: tardis-repo-${{ inputs.run_label }} +# path: ./ - - name: Setup tardis - uses: ./.github/actions/setup_tardis - with: - os-label: ${{ inputs.run_label }} +# - name: Setup tardis +# uses: ./.github/actions/setup_tardis +# with: +# os-label: ${{ inputs.run_label }} - - name: Install package editable - run: | - pip install -e . --user +# - name: Install package editable +# run: | +# pip install -e . --user - - name: Run tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} -m "not continuum" +# - name: Run tests +# run: pytest tardis ${{ env.PYTEST_FLAGS }} -m "not continuum" - - name: Refdata Generation tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference - if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master' +# - name: Refdata Generation tests +# run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference +# if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master' - continuum_tests: - needs: base - runs-on: ${{ inputs.run_label }} - steps: - - uses: actions/download-artifact@v4 - with: - name: tardis-repo-${{ inputs.run_label }} - path: ./ +# continuum_tests: +# needs: test-matrix +# runs-on: ${{ inputs.run_label }} +# steps: +# - uses: actions/download-artifact@v4 +# with: +# name: tardis-repo-${{ inputs.run_label }} +# path: ./ - - name: Setup tardis - uses: ./.github/actions/setup_tardis - with: - os-label: ${{ inputs.run_label }} +# - name: Setup tardis +# uses: ./.github/actions/setup_tardis +# with: +# os-label: ${{ inputs.run_label }} - - name: Install package editable - run: | - pip install -e . +# - name: Install package editable +# run: | +# pip install -e . - - name: Run continuum tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} -m continuum +# - name: Run continuum tests +# run: pytest tardis ${{ env.PYTEST_FLAGS }} -m continuum - - name: Refdata Generation tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference - if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master' +# - name: Refdata Generation tests +# run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference +# if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dab7e450cdf..9f6a54850fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,104 +1,104 @@ -# For more information about TARDIS pipelines, please refer to: -# -# https://tardis-sn.github.io/tardis/development/continuous_integration.html +# # For more information about TARDIS pipelines, please refer to: +# # +# # https://tardis-sn.github.io/tardis/development/continuous_integration.html -name: tests +# name: tests -on: - push: - branches: - - '*' +# on: +# push: +# branches: +# - '*' - pull_request: - branches: - - '*' +# pull_request: +# branches: +# - '*' - types: - - opened - - reopened - - synchronize - - labeled - -env: - CACHE_NUMBER: 0 # increase to reset cache manually - PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data - --cov=tardis --cov-report=xml --cov-report=html - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash -l {0} - -jobs: - build: - if: github.repository_owner == 'tardis-sn' - strategy: - matrix: - pip: [true, false] - label: [osx-arm64, linux-64] - include: - - label: osx-arm64 - os: macos-latest - prefix: /Users/runner/miniconda3/envs/tardis - - - label: linux-64 - os: ubuntu-latest - prefix: /usr/share/miniconda3/envs/tardis - - name: ${{ matrix.label }}-pip-${{ matrix.pip }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - - name: Setup LFS - uses: ./.github/actions/setup_lfs +# types: +# - opened +# - reopened +# - synchronize +# - labeled + +# env: +# CACHE_NUMBER: 0 # increase to reset cache manually +# PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data +# --cov=tardis --cov-report=xml --cov-report=html +# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + +# concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} +# cancel-in-progress: true + +# defaults: +# run: +# shell: bash -l {0} + +# jobs: +# build: +# if: github.repository_owner == 'tardis-sn' +# strategy: +# matrix: +# pip: [true, false] +# label: [osx-arm64, linux-64] +# include: +# - label: osx-arm64 +# os: macos-latest +# prefix: /Users/runner/miniconda3/envs/tardis + +# - label: linux-64 +# os: ubuntu-latest +# prefix: /usr/share/miniconda3/envs/tardis + +# name: ${{ matrix.label }}-pip-${{ matrix.pip }} +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/checkout@v4 + +# - name: Setup LFS +# uses: ./.github/actions/setup_lfs - - name: Setup environment - uses: ./.github/actions/setup_env - with: - os-label: ${{ matrix.label }} - - - name: Install package editable - run: | - pip install -e . - echo "TARDIS_PIP_PATH=tardis" >> $GITHUB_ENV - if: matrix.pip == false - - - name: Install package git - run: pip install git+https://github.com/tardis-sn/tardis.git@${{ github.ref }} - if: matrix.pip == true - - - name: Set pip path - if: matrix.pip == true - run: | - location_line=$(pip show tardis | grep -i -x "Location:.*") - directory_path=$(echo $location_line | awk -F " " '{print $2}') - echo "TARDIS_PIP_PATH=$directory_path" >> $GITHUB_ENV +# - name: Setup environment +# uses: ./.github/actions/setup_env +# with: +# os-label: ${{ matrix.label }} + +# - name: Install package editable +# run: | +# pip install -e . +# echo "TARDIS_PIP_PATH=tardis" >> $GITHUB_ENV +# if: matrix.pip == false + +# - name: Install package git +# run: pip install git+https://github.com/tardis-sn/tardis.git@${{ github.ref }} +# if: matrix.pip == true + +# - name: Set pip path +# if: matrix.pip == true +# run: | +# location_line=$(pip show tardis | grep -i -x "Location:.*") +# directory_path=$(echo $location_line | awk -F " " '{print $2}') +# echo "TARDIS_PIP_PATH=$directory_path" >> $GITHUB_ENV - - name: Set install path - if: matrix.pip == false - run: | - directory_path="." - echo "TARDIS_PIP_PATH=$directory_path" >> $GITHUB_ENV - - - name: Run tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} -m "not continuum" - working-directory: ${{ env.TARDIS_PIP_PATH }} - if: always() - - - name: Run continuum tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} -m continuum - working-directory: ${{ env.TARDIS_PIP_PATH }} - if: always() - - - name: Upload to Codecov - run: bash <(curl -s https://codecov.io/bash) +# - name: Set install path +# if: matrix.pip == false +# run: | +# directory_path="." +# echo "TARDIS_PIP_PATH=$directory_path" >> $GITHUB_ENV + +# - name: Run tests +# run: pytest tardis ${{ env.PYTEST_FLAGS }} -m "not continuum" +# working-directory: ${{ env.TARDIS_PIP_PATH }} +# if: always() + +# - name: Run continuum tests +# run: pytest tardis ${{ env.PYTEST_FLAGS }} -m continuum +# working-directory: ${{ env.TARDIS_PIP_PATH }} +# if: always() + +# - name: Upload to Codecov +# run: bash <(curl -s https://codecov.io/bash) - - name: Refdata Generation tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference - working-directory: ${{ env.TARDIS_PIP_PATH }} - if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master' +# - name: Refdata Generation tests +# run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference +# working-directory: ${{ env.TARDIS_PIP_PATH }} +# if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master'