diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7bbb446 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +# Author: A Taylor | Purpose: Continuous integration for tri-language test suites +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + # --------------------------------------------------------------------------- + # Python test suite (pytest + astropy.units) + # --------------------------------------------------------------------------- + python: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + cd python + pip install -e ".[dev]" + + - name: Run pytest + run: | + cd python + pytest tests/ -v --tb=short + + # --------------------------------------------------------------------------- + # C++ test suite (CMake + GoogleTest) + # --------------------------------------------------------------------------- + cpp: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Configure CMake + run: | + cd cpp + cmake -B build -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: | + cd cpp + cmake --build build + + - name: Run CTest + run: | + cd cpp/build + ctest --output-on-failure