Skip to content

Commit

Permalink
Merge branch 'develop' into win-kill
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu authored Jan 24, 2025
2 parents 286e692 + 5188024 commit e80603a
Show file tree
Hide file tree
Showing 1,165 changed files with 21,820 additions and 20,567 deletions.
4 changes: 2 additions & 2 deletions .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ cat <<EOF
FROM with-system-packages AS bootstrapped
#:bootstrapping:
RUN rm -rf /new /sage/.git
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 .gitignore /new/
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap configure.ac sage .homebrew-build-env tox.ini .gitignore /new/
$ADD config/config.rpath /new/config/config.rpath
$ADD src/doc/bootstrap /new/src/doc/bootstrap
$ADD src/bin /new/src/bin
$ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
$ADD src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
$ADD m4 /new/m4
$ADD pkgs /new/pkgs
$ADD build /new/build
Expand Down
5 changes: 2 additions & 3 deletions .devcontainer/onCreate-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda update -y --all --override-channels -c conda-forge
conda install mamba=1 -n base -y
mamba env create -y --file environment-dev-3.11-linux.yml || mamba env update -y --file environment-dev-3.11-linux.yml
mamba env create -y --file environment-3.11-linux.yml || mamba env update -y --file environment-3.11-linux.yml
conda init bash

# Build sage
conda run -n sage-dev ./bootstrap
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src
conda run -n sage-dev pip install --no-build-isolation -v -v -e .
104 changes: 3 additions & 101 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ concurrency:
#
# The three workflows:
#
# - build.yml (with jobs test-new, test-mod, test-long),
# - build.yml (with jobs test-new, test-long),
# - doc-build.yml,
# - doc-build-pdf.yml
#
Expand All @@ -50,7 +50,7 @@ concurrency:
# This baseline is transparently improved by our use of the GH Actions cache,
# see https://docs.docker.com/build/ci/github-actions/cache/#cache-backend-api.
#
# Jobs test-mod and test-long are only started after test-new completed;
# Jobs test-long is only started after test-new completed;
# but the workflows doc-build.yml and doc-build-pdf.yml are started independently.
#
# - When nothing is cached and the 3 workflows are launched in parallel,
Expand Down Expand Up @@ -254,104 +254,6 @@ jobs:
./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.doctests_all_changed_files }}
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}

test-mod:
runs-on: ubuntu-latest
needs: [test-new]
services:
# https://docs.docker.com/build/ci/github-actions/local-registry/
registry:
image: registry:2
ports:
- 5000:5000
strategy:
fail-fast: false
matrix:
targets:
- sagemath_categories-check
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@v10
with:
# need space in /var for Docker images
root-reserve-mb: 30000
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true

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

- name: Install test prerequisites
# From docker.yml
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
sudo apt-get clean
df -h
- name: Merge CI fixes from sagemath/sage
# From docker.yml
# This step needs to happen after the commit sha is put in DOCKER_TAG
# so that multi-stage builds can work correctly.
run: |
.ci/merge-fixes.sh
env:
GH_TOKEN: ${{ github.token }}

# Building

- name: Generate Dockerfile
# From docker.yml
run: |
tox -e ${{ env.TOX_ENV }}
cp .tox/${{ env.TOX_ENV }}/Dockerfile .
env:
# Only generate the Dockerfile, do not run 'docker build' here
DOCKER_TARGETS: ""

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host

- name: Build Docker image
id: image
uses: docker/build-push-action@v6
with:
push: true
load: false
context: .
tags: ${{ env.BUILD_IMAGE }}
target: with-targets
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
NUMPROC=6
USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse
TARGETS_PRE=build/make/Makefile
TARGETS=${{ needs.test-new.outputs.build_targets }}
- name: Start container
id: container
if: (success() || failure())
run: |
docker run --name BUILD -dit \
--mount type=bind,src=$(pwd),dst=$(pwd) \
--workdir $(pwd) \
${{ env.BUILD_IMAGE }} /bin/sh
# Testing

- name: Test modularized distributions
if: (success() || failure()) && steps.container.outcome == 'success'
run: |
export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4
make V=0 tox-ensure && make ${{ matrix.targets }}
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}

test-long:
runs-on: ubuntu-latest
needs: [test-new]
Expand Down Expand Up @@ -589,6 +491,6 @@ jobs:

- name: Upload coverage to codecov
if: (success() || failure()) && steps.container.outcome == 'success'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
directory: .coverage/coverage-report
23 changes: 23 additions & 0 deletions .github/workflows/changelog_trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Trigger Changelog Generation

on:
release:
types: [published]

jobs:
trigger-website-repo-workflow:
runs-on: ubuntu-latest
steps:
- name: Trigger Generate Changelog Workflow in website repo
if: "!github.event.release.prerelease"
env:
GITHUB_PAT: ${{ secrets.WEBSITE_ACCESS_TOKEN }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_PAT" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/sagemath/website/actions/workflows/generate_changelog.yml/dispatches \
-d '{"ref":"master","inputs":{"release_tag":"'"$RELEASE_TAG"'"}}'
17 changes: 3 additions & 14 deletions .github/workflows/ci-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,12 @@ jobs:
# On pushes to tags or branches, test the whole matrix.
os: >-
${{ github.event_name == 'pull_request'
&& fromJson('["ubuntu-latest"]')
&& fromJson('["ubuntu-latest", "macos-latest"]')
|| fromJson('["ubuntu-latest", "macos-latest", "macos-13"]') }}
python: >-
${{ github.event_name == 'pull_request'
&& fromJson('["3.9"]')
|| fromJson('["3.9", "3.10", "3.11"]') }}
python: ['3.11', '3.12']
# Optional environment is disabled for now as its not yet working
# environment: [environment, environment-optional]
conda-env: [environment]
# On pull requests, only test two jobs:
# Ubuntu with Python 3.9, macOS (arm64) with Python 3.11.
# Build & Test currently uses Python 3.10 (on ubuntu-jammy).
# Together, they cover the supported minor Python versions.
include: >-
${{ github.event_name == 'pull_request'
&& fromJson('[{"os": "macos-latest", "python": "3.11", "conda-env": "environment"}]')
|| fromJson('[]') }}

steps:
- uses: actions/checkout@v4
Expand All @@ -69,7 +58,7 @@ jobs:
use-mamba: true
channels: conda-forge
channel-priority: true
activate-environment: sage
activate-environment: sage-dev
environment-file: ${{ matrix.conda-env }}-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && (startsWith(runner.arch, 'ARM') && 'macos' || 'macos-x86_64') || 'linux' }}.yml

- name: Print Conda environment
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/ci-meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
python: ['3.9', '3.10', '3.11']
python: ['3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand All @@ -47,14 +47,14 @@ jobs:
key: ${{ runner.os }}-meson-${{ matrix.python }}

- name: Setup Conda environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python }}
miniforge-version: latest
use-mamba: true
channels: conda-forge
channel-priority: true
activate-environment: sage
activate-environment: sage-dev
environment-file: environment-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && (startsWith(runner.arch, 'ARM') && 'macos' || 'macos-x86_64') || 'linux' }}.yml

- name: Print Conda environment
Expand All @@ -69,11 +69,23 @@ jobs:
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CC="ccache $CC"
export CXX="ccache $CXX"
pip install --no-build-isolation --config-settings=builddir=builddir . -v
# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda
pip install --no-build-isolation --no-deps --config-settings=builddir=builddir . -v
- name: Verify dependencies
shell: bash -l {0}
run: pip check

- name: Test
shell: bash -l {0}
run: |
# We don't install sage_setup, so don't try to test it
rm -R ./src/sage_setup/
./sage -t --all -p4
- name: Upload log
uses: actions/[email protected]
if: failure()
with:
name: ${{ runner.os }}-meson-${{ matrix.python }}-log
path: builddir/meson-logs/
56 changes: 0 additions & 56 deletions .github/workflows/conda-lock-update.py

This file was deleted.

34 changes: 31 additions & 3 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,38 @@ jobs:
with:
name: dist
path: dist
- uses: softprops/action-gh-release@v2
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
latest_release_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \
| jq -r 'sort_by(.created_at) | last(.[]).tag_name')
release_notes=$(curl -s \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
-d "{
\"tag_name\": \"${{ github.ref_name }}\",
\"previous_tag_name\": \"$latest_release_tag\"
}" | jq -r '.body')
# escape special characters for json
release_notes=$(jq -R -s '.' <<< "$release_notes")
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d "{
\"tag_name\": \"${{ github.ref_name }}\",
\"prerelease\": ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }},
\"body\": $release_notes
}"
- name: Create release assets
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
files: |
dist/*
upstream/*
Expand Down
Loading

0 comments on commit e80603a

Please sign in to comment.