diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml new file mode 100644 index 000000000..2b0cefa09 --- /dev/null +++ b/.github/actions/test/action.yml @@ -0,0 +1,30 @@ +name: Test +description: "Builds pagmo2 from source via conda-provisioned toolchain and CMake, then runs the ctest suite. Extracted so this repo's own CI and mono's synced copy of this repo can call the identical steps locally -- see the \"Sharing CI with the monorepo\" pattern already shipped for the infrastructure repo. This is a new Linux x86_64 quality gate, adapted from the existing tools/circleci_ubuntu_arm64.sh build (not currently wired into GitHub Actions at all -- main.yml only runs the macOS/Windows/docs jobs), without that script's ASAN-specific suppressions and fork_island exclusion, since this gate runs a plain Debug build with no sanitizer. Deliberately scoped to the quality gate only, not the docs-deploy pipeline in main.yml, which stays upstream-shaped." + +inputs: + working-directory: + description: Directory containing the pagmo2 CMake project to build and test + required: false + default: "." + +runs: + using: composite + steps: + - name: install conda toolchain and pagmo2 build dependencies + shell: bash + run: | + wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniconda.sh + bash miniconda.sh -b -p "$HOME/miniconda" + echo "$HOME/miniconda/bin" >> "$GITHUB_PATH" + export PATH="$HOME/miniconda/bin:$PATH" + conda create -y -q -p "$HOME/local" c-compiler cxx-compiler cmake eigen nlopt ipopt boost-cpp tbb tbb-devel + echo "PAGMO2_CONDA_PREFIX=$HOME/local" >> "$GITHUB_ENV" + - name: build and test + shell: bash + working-directory: ${{ inputs.working-directory }} + run: | + source "$HOME/miniconda/bin/activate" "$PAGMO2_CONDA_PREFIX" + mkdir -p build && cd build + cmake ../ -DCMAKE_PREFIX_PATH="$PAGMO2_CONDA_PREFIX" -DCMAKE_BUILD_TYPE=Debug -DPAGMO_BUILD_TESTS=yes -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DPAGMO_WITH_IPOPT=yes + make -j2 VERBOSE=1 + ctest -j4 -V diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..855179931 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,16 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + runs-on: gha-ci-runners + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 383f80f88..5106ac1e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: shell: powershell build-and-deploydocs: if: ${{ github.event_name }} == 'push' - runs-on: ubuntu-latest + runs-on: gha-ci-runners steps: - uses: actions/checkout@v2 - name: Install and Build 🔧