Skip to content

Commit

Permalink
Merge pull request #248 from saraedum/conda-pack
Browse files Browse the repository at this point in the history
Automatically build flatsurf installer
  • Loading branch information
saraedum authored Sep 25, 2024
2 parents f1cbb4a + fed087e commit b9c7c0a
Show file tree
Hide file tree
Showing 108 changed files with 24,397 additions and 695 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically propose to upgrade GitHub actions when new versions become available.
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
dependencies:
patterns:
- "*"
65 changes: 27 additions & 38 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,34 @@ concurrency:

jobs:
asv:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest", python-version: "3.9" }
- name: Install dependencies
run: |
mamba install -n test -y pip
conda list
- name: Checkout historic performance data
uses: actions/checkout@v2
with:
path: .asv/results
ref: asv
- name: Run benchmarks
uses: flatsurf/actions/asv@main
- name: Update historic performance data
uses: EndBug/add-and-commit@v5
with:
author_name: asv bot
author_email: bot@flatsurf.org
message: 'record asv run'
cwd: .asv/results
branch: asv
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'push' }}
- uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
folder: .asv/html
target-folder: docs/asv
if: ${{ github.event_name == 'push' }}
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with: { pixi-version: v0.28.2, environments: asv, activate-environment: true }
- name: Checkout historic performance data
uses: actions/checkout@v4
with: { path: ./asv/results, ref: asv }
- name: Run benchmarks
uses: flatsurf/actions/asv@main
with: { packages: pixi }
- name: Update historic performance data
uses: EndBug/add-and-commit@v5
with:
author_name: asv bot
author_email: bot@flatsurf.org
message: 'record asv run'
cwd: .asv/results
branch: asv
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'push' }}
- uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
folder: .asv/html
target-folder: docs/asv
if: ${{ github.event_name == 'push' }}

env:
MAKEFLAGS: -j4
64 changes: 0 additions & 64 deletions .github/workflows/conda.yml

This file was deleted.

31 changes: 10 additions & 21 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,16 @@ concurrency:

jobs:
build-manual:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with: { submodules: recursive }
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" }
- name: install dependencies
run: |
mamba env update -n test --quiet -f flatsurf.yml
mamba env update -n test --quiet -f doc/environment.yml
conda list
- name: install sage-flatsurf
run: |
pip install --verbose --no-index .
# Show message about cppyy regenerating pre-compiled headers so it does not show during the tests
python -c 'import cppyy' || true
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with: { pixi-version: v0.28.2 }
- name: build documentation
run: |
cd doc
make html SPHINXOPTS="-W -n --keep-going"
pixi run doc
# Do not run Jekyll to create GitHub Pages but take HTML files as they are.
touch _build/html/.nojekyll
touch doc/_build/html/.nojekyll
- name: provide documentation as artifact for netlify workflow
uses: actions/upload-artifact@v3
with:
Expand All @@ -48,3 +33,7 @@ jobs:
if: ${{ github.event_name == 'push' }}
- uses: flatsurf/actions/show-logs@main
if: ${{ always() }}

env:
MAKEFLAGS: -j4
SAGE_NUM_THREADS: 4
73 changes: 73 additions & 0 deletions .github/workflows/installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Builds Linux/macOS and Windows installers and stores them as artifacts that
# can be downloaded from the workflow run.
# Currently, we need to manually attach these artifacts to each release
# so that the installers are available from our "Release" page on GitHub.
name: Build Installer
on:
push: { branches: [ "master" ] }
pull_request: { branches: [ "master" ] }

concurrency:
group: installer-${{ github.ref }}
cancel-in-progress: true

jobs:
unix:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Create installer
run: ./installer/unix/build-installer.sh
- name: Provide installer as a build artifact
uses: actions/upload-artifact@v4
with:
name: unix-installer
path: ./*.unix.tar.gz
unix-test:
runs-on: ${{ matrix.on }}
needs: [ unix ]
strategy:
matrix:
on: [ ubuntu-24.04, macos-13, macos-14 ]
steps:
- uses: actions/download-artifact@v4
with:
name: unix-installer
- name: Extract installer
run: |
tar zxf *.tar.gz
- name: Test that SageMath REPL is functional
run: ./sage-flatsurf*/sage -c 'print(1 + 1)'
windows:
runs-on: windows-latest
needs: [ unix ]
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: actions/download-artifact@v4
with:
name: unix-installer
path: installer/win/
- name: Set version number
shell: bash
run: |
source installer/unix/version.sh
sed -i -e 's/VERSION/'$VERSION'/g' installer/win/installer.iss installer/win/launch.ps1
- name: Download wsldl executable
shell: bash
run: |
dos2unix installer/win/wsldl.exe.sha256
curl -fsSL https://github.com/yuk7/wsldl/releases/download/23051400/wsldl.exe | tee wsldl.exe | sha256sum -c installer/win/wsldl.exe.sha256
source installer/unix/version.sh
mv wsldl.exe installer/win/sage-flatsurf-$VERSION.exe
- name: Compile .iss to .exe installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: installer/win/installer.iss
options: /O+
- name: Provide installer as a build artifact
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: ./installer/win/Output/*.exe
103 changes: 25 additions & 78 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,92 +9,39 @@ concurrency:

jobs:
codespell:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with: { submodules: recursive }
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" }
- name: Install dependencies
run: |
mamba install codespell=2.2.2
- name: Run codespell
run: codespell flatsurf
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with: { pixi-version: v0.28.2 }
- run: pixi run codespell
pycodestyle:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with: { submodules: recursive }
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" }
- name: Install dependencies
run: |
mamba install pycodestyle=2.9.1
- name: Run pycodestyle
run: |
# We ignore warnings that are incompatible with black's formatting rules
pycodestyle --ignore=E203,W503 --max-line-length=256 flatsurf/ test/
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with: { pixi-version: v0.28.2 }
- run: pixi run pycodestyle
pylint:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with: { submodules: recursive }
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" }
- name: Install dependencies
run: |
mamba env update -n test --quiet -f environment.yml
- name: Install sage-flatsurf
run: |
pip install -e .
- name: Run pylint
run: |
# A lot of linters are disabled, see .pylintrc. We should enable most of them eventually.
pylint flatsurf
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with: { pixi-version: v0.28.2 }
- run: pixi run pylint
ruff:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with: { submodules: recursive }
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" }
- name: Install dependencies
run: |
mamba env update -n test --quiet -f environment.yml
- name: Run ruff
run: |
ruff check --select C4,UP008,UP031,UP034 .
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with: { pixi-version: v0.28.2 }
- run: pixi run ruff
black:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with: { submodules: recursive }
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" }
- name: Install dependencies
run: |
mamba env update -n test --quiet -f environment.yml
mamba install black=22.12
- name: Run black
run: |
black `find flatsurf -name '*.py'`
# We run our notebooks through black to make sure everything is nicely formatted in our examples.
# Consequently, we cannot use SageMath syntax in the notebooks. (But presently we do not need it anyway.)
jupytext --sync --pipe black doc/examples/*.md
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with: { pixi-version: v0.28.2 }
- run: pixi run black
- name: Detect changes
run: git diff --exit-code
Loading

0 comments on commit b9c7c0a

Please sign in to comment.