Skip to content

Commit

Permalink
Merge pull request litalbarkai#8 from pachadotdev/main
Browse files Browse the repository at this point in the history
refactors to use C++11 and pugixml
  • Loading branch information
litalbarkai authored Nov 20, 2024
2 parents a60bb3a + 0371290 commit a240c61
Show file tree
Hide file tree
Showing 230 changed files with 22,347 additions and 6,397 deletions.
104 changes: 0 additions & 104 deletions .github/workflows/build-cpp.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build Mac executables

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: macos-13

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up environment on Mac
run: |
brew install qt@5
echo "/usr/local/opt/qt@5/bin" >> $GITHUB_PATH
echo "LDFLAGS=-L/usr/local/opt/qt@5/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I/usr/local/opt/qt@5/include" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/opt/qt@5/lib/pkgconfig" >> $GITHUB_ENV
- name: Build redatam and redatamgui on Mac
run: make all

- name: Create .app bundle for redatamgui
run: |
mkdir -p RedatamGUI.app/Contents/MacOS
mkdir -p RedatamGUI.app/Contents/Resources
cp redatamgui RedatamGUI.app/Contents/MacOS/
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleExecutable</key>
<string>redatamgui</string>
<key>CFBundleIdentifier</key>
<string>com.pacha.openredatam</string>
<key>CFBundleName</key>
<string>Redatam GUI</string>
<key>CFBundleVersion</key>
<string>2.0</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
</dict>
</plist>" > RedatamGUI.app/Contents/Info.plist
# Add your icon file to the Resources directory if you have one
# cp path/to/icon.icns RedatamGUI.app/Contents/Resources/
- name: Bundle Qt libraries on Mac
run: |
/usr/local/opt/qt@5/bin/macdeployqt RedatamGUI.app
- name: Create DMG
run: |
mkdir -p dmg-root/Applications
cp -R RedatamGUI.app dmg-root/Applications/
cp redatam dmg-root/Applications/
hdiutil create -volname "Redatam" -srcfolder dmg-root -ov -format UDZO open-redatam-mac.dmg
- name: Upload macOS DMG
uses: actions/upload-artifact@v4
with:
name: open-redatam-mac
path: open-redatam-mac.dmg
77 changes: 77 additions & 0 deletions .github/workflows/build-pypkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Python package

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions: read-all

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8]

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Update pip to the latest version
run: python -m pip install --upgrade pip

- name: Create and activate virtual environment (Linux and macOS)
if: runner.os != 'Windows'
run: |
cd pypkg
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
- name: Create and activate virtual environment (Windows)
if: runner.os == 'Windows'
run: |
cd pypkg
python -m venv venv
venv\Scripts\activate
python -m pip install --upgrade pip
- name: Install dependencies (Linux and macOS)
if: runner.os != 'Windows'
run: |
cd pypkg
source venv/bin/activate
pip install pandas numpy pybind11
pip install --use-pep517 .
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
cd pypkg
venv\Scripts\activate
pip install pandas numpy pybind11
pip install --use-pep517 .
- name: Run tests (Linux and macOS)
if: runner.os != 'Windows'
run: |
cd pypkg
source venv/bin/activate
python tests/basic-test.py
- name: Run tests (Windows)
if: runner.os == 'Windows'
run: |
cd pypkg
venv\Scripts\activate
python tests/basic-test.py
56 changes: 56 additions & 0 deletions .github/workflows/build-rpkg-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main]
pull_request:
branches: [main]

name: R package (Docker)

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
container: ${{ matrix.config.container }}

name: ${{ matrix.config.name }}

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/ubuntu-gcc12:latest' }, name: 'r-devel-linux-x86_64-debian-gcc'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/ubuntu-clang:latest' }, name: 'r-devel-linux-x86_64-debian-clang'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/atlas:latest' }, name: 'ATLAS'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/c23:latest' }, name: 'C23'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/clang-asan:latest' }, name: 'clang-ASAN'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/clang16:latest' }, name: 'clang16'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/clang17:latest' }, name: 'clang17'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/clang18:latest' }, name: 'clang18'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/clang19:latest' }, name: 'clang19'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/clang20:latest' }, name: 'clang20'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/donttest:latest' }, name: 'donttest'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/gcc13:latest' }, name: 'gcc13'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/gcc13:latest' }, name: 'gcc14'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/intel:latest' }, name: 'intel'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/mkl:latest' }, name: 'mkl'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/nold:latest' }, name: 'noLD'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/noremap:latest' }, name: 'noRemap'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/valgrind:latest' }, name: 'rchk'}
- {os: ubuntu-latest, container: { image: 'ghcr.io/r-hub/containers/valgrind:latest' }, name: 'valgrind'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check package
run: |
cd ./rpkg
R -q -e 'pak::pkg_install(c("deps::.", "any::rcmdcheck"), dependencies = TRUE)'
R -q -e 'rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), build_args = "--no-manual", error_on = "error")'
62 changes: 46 additions & 16 deletions .github/workflows/build-rpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,69 @@ jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})
name: ${{ matrix.config.name }}

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}

- {os: macos-13, r: 'release', name: 'macos-13-r-release'}
- {os: macos-14, r: 'release', name: 'macos-14-r-release'}
- {os: ubuntu-latest, r: 'release', name: 'ubuntu-latest-r-release'}
- {os: windows-latest, r: 'release', name: 'windows-latest-r-release'}
- {os: macos-13, r: 'devel', name: 'macos-13-r-devel'}
- {os: macos-14, r: 'devel', name: 'macos-14-r-devel'}
- {os: ubuntu-latest, r: 'devel', name: 'ubuntu-latest-r-devel'}
- {os: windows-latest, r: 'devel', name: 'windows-latest-r-devel'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
- name: Restore R package cache
uses: actions/cache@v4
with:
working-directory: './rpkg'
extra-packages: any::rcmdcheck
needs: check
path: ~/.cache/R
key: ${{ runner.os }}-r-${{ matrix.config.r }}-cache

- name: Install libpng (macOS)
if: matrix.config.os == 'macos-14' && matrix.config.r == 'devel'
run: |
curl -LO https://mac.r-project.org/bin/darwin20/arm64/libpng-1.6.38-darwin.20-arm64.tar.xz
sudo tar -xvf libpng-1.6.38-darwin.20-arm64.tar.xz -C /
echo "PKG_CONFIG_PATH=/opt/R/arm64/lib/pkgconfig" >> $GITHUB_ENV
- name: Install dependencies
run: |
Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) { install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") }'
Rscript -e 'pak::pkg_install("decor", dependencies = TRUE)'
Rscript -e 'pak::pkg_install("rcmdcheck", dependencies = TRUE)'
Rscript -e 'pak::pkg_install("pkgbuild", dependencies = TRUE)'
Rscript -e 'pak::pkg_install(".", dependencies = TRUE)'
working-directory: ./rpkg

- name: Check
run: |
Rscript -e 'pkgbuild::check_build_tools(debug = TRUE)'
Rscript -e 'rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), build_args = "--no-manual", error_on = "error")'
working-directory: ./rpkg

- uses: r-lib/actions/check-r-package@v2
- name: Save R package cache
uses: actions/cache@v4
with:
working-directory: './rpkg'
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
path: ~/.cache/R
key: ${{ runner.os }}-r-${{ matrix.config.r }}-cache
Loading

0 comments on commit a240c61

Please sign in to comment.