Skip to content

DEV: setup pixi #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
49 changes: 8 additions & 41 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ name: Linux Tests
on: [ push, pull_request ]

permissions:
contents: read # to fetch code (actions/checkout)
contents: read # to fetch code (actions/checkout)

env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
INSTALLDIR: "build-install"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -22,44 +21,12 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout xsref
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: prefix-dev/setup-pixi@92815284c57faa15cd896c4d5cfb2d59f32dc43d # v0.8.3
with:
repository: 'scipy/xsref'
path: 'xsref'
ref: 'main'

- name: Checkout Catch2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: 'catchorg/Catch2'
path: 'Catch2'
ref: 'v3.8.0'

- name: Install Ubuntu dependencies
run: |
sudo apt-get update
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt-get install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt-get update
sudo apt-get install -y -V libarrow-dev # For C++
sudo apt-get install -y -V libarrow-glib-dev # For GLib (C)
sudo apt-get install -y -V libarrow-dataset-dev # For Apache Arrow Dataset C++
sudo apt-get install -y -V libparquet-dev # For Apache Parquet C++
sudo apt-get install -y -V libparquet-glib-dev # For Apache Parquet GLib (C)
sudo apt-get install -y libzstd-dev ccache

- name: Install Catch2
run: |
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install -j2
working-directory: ./Catch2

- name: Configure and build
run: |
cmake -Bbuild
cmake --build build -j2

- name: run tests
pixi-version: v0.44.0
cache: true
- name: Run tests
run: |
ctest --output-on-failure --test-dir build/tests -j2
pixi run configure-tests
pixi run build-only -j2
pixi run tests -j2
Comment on lines +30 to +32
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite right, since xsref isn't cloned until the last step.

Suggested change
pixi run configure-tests
pixi run build-only -j2
pixi run tests -j2
pixi run clone-xsref
pixi run configure-tests
pixi run build-only -j2
pixi run --skip-deps tests -j2

26 changes: 10 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,15 @@
*.out
*.app

# CMake stuff
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json
*.cmake
DartConfiguration.tcl
# cmake build
build/

# test executable extension
build/
*.test

# pixi environments
.pixi
*.egg-info

# xsref
xsref/
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Tests
enable_testing()
add_subdirectory(tests)
option(BUILD_TESTS "Build the tests" OFF)

if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# xsf
Special function implementations

## Tests

To run the tests:
- [clone this repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
- `cd xsf`
- [install Pixi](https://pixi.sh/latest/#installation)
- `pixi run tests`

For subsequent test runs, you can skip re-cloning [`xsref`](https://github.com/scipy/xsref) with:

```shell
pixi run --skip-deps tests
```

You can trigger a rebuild inbetween test runs with:

```shell
pixi run build-tests
```

> [!NOTE]
> This has currently only been tested on Linux.
Loading