diff --git a/.github/workflows/build-doc.yml b/.github/workflows/build-doc.yml index 5be02d4d5..bd97a0478 100644 --- a/.github/workflows/build-doc.yml +++ b/.github/workflows/build-doc.yml @@ -18,7 +18,7 @@ jobs: shell: bash -el {0} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" @@ -29,10 +29,10 @@ jobs: - name: Get Date id: get-date - run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" + run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT - name: Cache Conda env - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.CONDA }}/envs key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment_doc.yml') }}-${{ env.CACHE_NUMBER }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1e1edcf1..7b13f9415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: name: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Install system dependencies if: matrix.sys-package-install-command != '' @@ -43,7 +43,7 @@ jobs: run: ${{ matrix.setup-env-command }} - name: Setup uv - uses: astral-sh/setup-uv@v6 + uses: astral-sh/setup-uv@v7 - name: Editable install run: | diff --git a/.github/workflows/carma-conda.yml b/.github/workflows/carma-conda.yml index 42527c6a5..8acb7ef0f 100644 --- a/.github/workflows/carma-conda.yml +++ b/.github/workflows/carma-conda.yml @@ -4,79 +4,37 @@ on: workflow_dispatch: jobs: - Linux: - name: Linux - runs-on: "ubuntu-latest" - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - activate-environment: packaging - - name: Conda build for Linux - shell: bash -l {0} - run: | - conda update --all - conda install python=3.11 conda-build anaconda-client conda-verify - conda-build carma.recipe -c conda-forge -c set3mah --output-folder . - anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }} - anaconda upload linux-64/*.conda --force - anaconda logout - - macos: - name: MacOS - runs-on: "macos-14" - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - activate-environment: packaging - - name: Conda build for MacOS - shell: bash -l {0} - run: | - conda update --all - conda install python=3.11 conda-build anaconda-client conda-verify - conda-build carma.recipe -c conda-forge -c set3mah --output-folder . - anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }} - anaconda upload osx-64/*.conda --force - anaconda logout - - macos-arm64: - name: MacOS-arm64 - runs-on: "macos-14-arm64" - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - activate-environment: packaging - - name: Conda build for MacOS - arm64 - shell: bash -l {0} - run: | - conda update --all - conda install python=3.11 conda-build anaconda-client conda-verify - conda-build carma.recipe -c conda-forge -c set3mah --output-folder . - anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }} - anaconda upload osx-arm64/*.conda --force - anaconda logout + build: + name: ${{ matrix.os }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - os: Linux + runner: ubuntu-latest + target-platform: linux-64 + - os: MacOS + runner: macos-latest + target-platform: osx-arm64 + - os: Windows + runner: windows-latest + target-platform: win-64 - - windows: - name: Windows - runs-on: "windows-latest" steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v6 + + - uses: conda-incubator/setup-miniconda@v3 with: - miniconda-version: "latest" + miniconda-version: latest activate-environment: packaging - - name: Conda build for Windows - shell: pwsh + + - name: Conda build and upload + shell: bash -l {0} + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} run: | - conda update --all - conda install python=3.11 conda-build anaconda-client conda-verify - conda-build carma.recipe -c conda-forge -c set3mah --output-folder . - anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }} - anaconda upload win-64/*.conda --force - anaconda logout + conda update --all -y + conda install -y python=3.11 conda-build anaconda-client conda-verify + conda-build carma.recipe -c conda-forge -c set3mah --output-folder . + anaconda upload ${{ matrix.target-platform }}/*.conda --force diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f55dd4335..1e2aaee8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,4 @@ name: Build & Test -#build and test on the three OS on: workflow_dispatch: @@ -13,96 +12,61 @@ permissions: actions: read jobs: - Linux: - name: Linux - runs-on: "ubuntu-latest" + build-and-test: + name: ${{ matrix.os }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - os: Linux + runner: ubuntu-latest + environment-file: environment.yml + shell: bash -l {0} + - os: MacOS + runner: macos-latest + environment-file: environment_arm64.yml + shell: bash -l {0} + - os: Windows + runner: windows-latest + environment-file: environment_win.yml + shell: pwsh + + defaults: + run: + shell: ${{ matrix.shell }} + steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 + - uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" activate-environment: foo - python-version: "3.12" - environment-file: environment.yml + python-version: "3.14" + environment-file: ${{ matrix.environment-file }} channels: conda-forge,set3mah - - name: Prepare conda environment - shell: bash -l {0} + - name: Prepare conda environment (Unix) + if: runner.os != 'Windows' run: | conda config --env --add channels conda-forge conda config --env --add channels set3mah conda config --env --set channel_priority strict - - name: Build for Linux - shell: bash -l {0} + - name: Build (Unix) + if: runner.os != 'Windows' run: | - cmake -S . -B ${{github.workspace}}/build -G Ninja \ + cmake -S . -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INCLUDE_PATH=$CONDA_PREFIX/include \ -DCMAKE_LIBRARY_PATH=$CONDA_PREFIX/lib \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ -Wno-dev - cmake --build ${{github.workspace}}/build - - - name: Tests - shell: bash -l {0} - run: ctest --test-dir ${{github.workspace}}/build --output-on-failure - - - name: Upload test logs as artifact - if: always() # Ensure this step runs even if the tests fail - uses: actions/upload-artifact@v4 - with: - name: test-logs-Linux - path: build/Testing/Temporary/LastTest.log - retention-days: 7 + cmake --build build - MacOS: - name: MacOS - runs-on: "macos-latest" - steps: - - uses: actions/checkout@v5 - - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - activate-environment: foo - environment-file: environment_arm64.yml - - - name: Build for MacOS - shell: bash -l {0} - run: | - cmake -S . -B ${{github.workspace}}/build -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INCLUDE_PATH=$CONDA_PREFIX/include \ - -DCMAKE_LIBRARY_PATH=$CONDA_PREFIX/lib \ - -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - -Wno-dev - cmake --build ${{github.workspace}}/build - - - name: Tests - shell: bash -l {0} - run: ctest --test-dir ${{github.workspace}}/build --output-on-failure - - - name: Upload test logs as artifact - if: always() # Ensure this step runs even if the tests fail - uses: actions/upload-artifact@v4 - with: - name: test-logs-OSX - path: build/Testing/Temporary/LastTest.log - retention-days: 7 - - Windows: - name: Windows - runs-on: "windows-latest" - steps: - - uses: actions/checkout@v5 - - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - activate-environment: foo - environment-file: environment_win.yml - - - name: Build for Windows - shell: pwsh + - name: Build (Windows) + if: runner.os == 'Windows' run: | cmake -S . -B build ` -DCMAKE_BUILD_TYPE=Release ` @@ -110,14 +74,18 @@ jobs: -Wno-dev cmake --build build --config Release - - name: Tests - shell: pwsh + - name: Tests (Unix) + if: runner.os != 'Windows' + run: ctest --test-dir build --output-on-failure + + - name: Tests (Windows) + if: runner.os == 'Windows' run: ctest --test-dir build -C Release --output-on-failure -VV - name: Upload test logs as artifact - if: always() # Ensure this step runs even if the tests fail + if: always() uses: actions/upload-artifact@v4 with: - name: test-logs-Win + name: test-logs-${{ matrix.os }} path: build/Testing/Temporary/LastTest.log retention-days: 7 diff --git a/.github/workflows/conda-packaging-linux.yml b/.github/workflows/conda-packaging-linux.yml deleted file mode 100644 index 3f931864e..000000000 --- a/.github/workflows/conda-packaging-linux.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Conda packaging linux - -on: - workflow_dispatch: - -jobs: - Linux: - name: Linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - auto-update-conda: true - - - name: Install Dependencies - shell: bash -l {0} - run: | - conda update --all - conda clean --all - conda install conda-build anaconda-client conda-verify - conda config --set anaconda_upload no - - - name: Build Package - shell: bash -l {0} - run: | - conda-build conda.recipe -c set3mah -c conda-forge --no-test --output-folder . - - - name: Upload to Anaconda - shell: bash -l {0} - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - run: | - anaconda upload linux-64/*.conda --force - diff --git a/.github/workflows/conda-packaging-osx-64.yml b/.github/workflows/conda-packaging-osx-64.yml deleted file mode 100644 index e531ef9cf..000000000 --- a/.github/workflows/conda-packaging-osx-64.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Conda packaging osx-x86-64 - -on: - workflow_dispatch: - -jobs: - macos: - name: MacOS - runs-on: macos-latest - - steps: - - uses: actions/checkout@v4 - - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - auto-update-conda: true - - - name: Configure Conda for osx-64 - shell: bash -l {0} - run: | - conda config --set subdir osx-64 - echo "CONDA_SUBDIR=osx-64" >> $GITHUB_ENV - - - name: Install Dependencies - shell: bash -l {0} - run: | - conda update --all - conda clean --all - conda install conda-build anaconda-client conda-verify - conda config --set anaconda_upload no - - - name: Build Package - shell: bash -l {0} - run: | - conda-build conda.recipe -c set3mah -c conda-forge --no-test --output-folder . - - - name: Upload Conda Packages - shell: bash -l {0} - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - run: | - anaconda upload osx-64/*.conda --force diff --git a/.github/workflows/conda-packaging-osx-arm64.yml b/.github/workflows/conda-packaging-osx-arm64.yml deleted file mode 100644 index 95a83fb50..000000000 --- a/.github/workflows/conda-packaging-osx-arm64.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Conda packaging osx-arm64 - -on: - workflow_dispatch: - -jobs: - macos: - name: MacOS - runs-on: macos-latest - - steps: - - uses: actions/checkout@v4 - - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - auto-update-conda: true - - - name: Configure Conda for osx-arm64 - shell: bash -l {0} - run: | - conda config --set subdir osx-arm64 - echo "CONDA_SUBDIR=osx-arm64" >> $GITHUB_ENV - - - name: Install Dependencies - shell: bash -l {0} - run: | - conda update --all - conda clean --all - conda install conda-build anaconda-client conda-verify - conda config --set anaconda_upload no - - - name: Build Package - shell: bash -l {0} - run: | - conda-build conda.recipe -c set3mah -c conda-forge --no-test --output-folder . - - - name: Upload Conda Packages - shell: bash -l {0} - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - run: | - anaconda upload osx-arm64/*.conda --force \ No newline at end of file diff --git a/.github/workflows/conda-packaging-windows.yml b/.github/workflows/conda-packaging-windows.yml deleted file mode 100644 index 116d7faa7..000000000 --- a/.github/workflows/conda-packaging-windows.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Conda packaging windows - -on: - workflow_dispatch: - -jobs: - windows: - name: Windows - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - - - name: Install Dependencies - shell: pwsh - run: | - conda update --all - conda clean --all - conda install conda-build anaconda-client conda-verify - conda config --set anaconda_upload no - - - name: Build Package - shell: pwsh - run: | - conda-build conda.recipe -c set3mah -c conda-forge --no-test --output-folder . - - - name: Upload to Anaconda - shell: pwsh - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - run: | - set ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }} - anaconda upload win-64/*.conda --force \ No newline at end of file diff --git a/.github/workflows/conda-packaging.yml b/.github/workflows/conda-packaging.yml index 74a885ce4..4690ce010 100644 --- a/.github/workflows/conda-packaging.yml +++ b/.github/workflows/conda-packaging.yml @@ -2,13 +2,29 @@ name: Conda packaging on: workflow_dispatch: + inputs: + upload: + description: 'Upload packages to Anaconda' + type: boolean + default: true + workflow_call: + inputs: + upload: + description: 'Upload packages to Anaconda' + type: boolean + default: true + ref: + description: 'Git ref to checkout' + type: string + required: false + secrets: + ANACONDA_API_TOKEN: + required: false pull_request: paths: - - "CMakeLists.txt" - - "**/CMakeLists.txt" - - "conda.recipe/**" - - ".github/workflows/conda-packaging.yml" - - "environment*.yml" + - 'conda.recipe/**' + - '.github/workflows/conda-packaging.yml' + - 'environment*.yml' permissions: contents: read @@ -33,7 +49,10 @@ jobs: target-platform: win-64 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.ref }} + - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest @@ -42,8 +61,6 @@ jobs: conda-solver: libmamba - name: Conda build - env: - CONDA_BUILD_LOCAL: ${{ github.event_name == 'pull_request' && '1' || '' }} shell: bash -l {0} run: | conda install -y conda-build conda-index @@ -166,7 +183,8 @@ jobs: conda run -n test-install python -c "import simcoon; import simcoon.simmit; print('Import successful')" - name: Upload to Anaconda - if: github.event_name == 'workflow_dispatch' + if: inputs.upload + shell: bash -l {0} env: ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..ec97ea89a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + release: + types: [published] + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + tag: + description: 'Tag to release (e.g., v1.0.0)' + required: true + +jobs: + conda-packaging: + uses: ./.github/workflows/conda-packaging.yml + with: + upload: true + ref: ${{ inputs.tag || github.ref }} + secrets: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} diff --git a/conda.recipe/conda_build_config.yaml b/conda.recipe/conda_build_config.yaml index 9ad4bc7a3..8f30a6e0d 100755 --- a/conda.recipe/conda_build_config.yaml +++ b/conda.recipe/conda_build_config.yaml @@ -3,3 +3,4 @@ python: - 3.11 - 3.12 - 3.13 + - 3.14 diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 52505d8b6..785aa72c1 100755 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -36,7 +36,6 @@ requirements: - numpy >=2.0 - libblas - liblapack - - boost >=1.84 run: - python - numpy >=2.0 @@ -47,7 +46,6 @@ requirements: - mkl # [x86] - blas * openblas # [not (osx and arm64) and not x86] - lapack * openblas # [not (osx and arm64) and not x86] - - boost >=1.84 - armadillo >=12.6 # [not win] test: diff --git a/environment_win.yml b/environment_win.yml index a397726ee..7074b37c0 100644 --- a/environment_win.yml +++ b/environment_win.yml @@ -1,8 +1,8 @@ name: my-env channels: - - set3mah - conda-forge + - set3mah dependencies: - pkg-config @@ -16,7 +16,7 @@ dependencies: - gtest - pybind11 - armadillo >= 12.6 - - set3mah::carma + - carma - pytest - ninja - mkl diff --git a/pyproject.toml b/pyproject.toml index fc127051b..20defb5a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Physics", "Topic :: Scientific/Engineering :: Mathematics",