Skip to content

Add cmake + native windows support for asymptote, with fully working make support #309

Add cmake + native windows support for asymptote, with fully working make support

Add cmake + native windows support for asymptote, with fully working make support #309

name: build-asy-cxx
on:
workflow_dispatch:
pull_request:
branches:
- "master"
- "a/*"
push:
branches:
- msvc-*
jobs:
configure-linux-release-x64:
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- run: cmake --preset linux/release-ccache
- name: tar+gz cmake configuration
run: tar -czf cmake-linux-cfg-artifact.tar.gz --exclude='vcpkg_installed' cmake-build-linux/release
- name: Upload configuration artifacts
uses: actions/upload-artifact@v4
with:
name: cmake-linux-x64-release-cfg-tgz
path: cmake-linux-cfg-artifact.tar.gz
build-linux-release-x64:
needs: configure-linux-release-x64
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- name: Download configuration artifacts
uses: actions/download-artifact@v4
with:
name: cmake-linux-x64-release-cfg-tgz
- name: Untar configuration artifact
run: tar -xzf cmake-linux-cfg-artifact.tar.gz
# Why we are defining version here and not in configuration stage is because cmake gets
# re-run here
- name: Generate version suffix
run: |
echo set\(ASY_VERSION_SUFFIX \"/github-ci/ref=${{ github.sha }}\"\) > asy-pkg-version-suffix.cmake
- run: cmake --build --preset linux/release --target asy-with-basefiles -j
- name: Archive build files
uses: actions/upload-artifact@v4
with:
name: asy-buildfiles
path: |
cmake-build-linux/release/asy
cmake-build-linux/release/base
- name: Build Asymptote google test files
run: cmake --build --preset linux/release --target asyCxxTests -j
- name: Archive Asymptote gtest files
uses: actions/upload-artifact@v4
with:
name: asy-gtest-files
path: |
cmake-build-linux/release/cxxtests/asyCxxTests
cmake-build-linux/release/cxxtests/*.cmake
- name: Archive Asymptote test files
uses: actions/upload-artifact@v4
with:
name: asy-testfiles
path: cmake-build-linux/release/CTest*.cmake
test-x64-cxxtests:
needs: build-linux-release-x64
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- name: Download test artifacts
uses: actions/download-artifact@v4
with:
name: asy-testfiles
path: cmake-build-linux/release/
- name: Download artifacts for gtest
uses: actions/download-artifact@v4
with:
name: asy-gtest-files
path: cmake-build-linux/release/cxxtests
- run: chmod +x cmake-build-linux/release/cxxtests/asyCxxTests
- name: google test
run: ctest --test-dir cmake-build-linux/release -R "^cxxtests."
test-x64-asy-tests:
needs: build-linux-release-x64
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: asy-buildfiles
path: cmake-build-linux/release/
- name: Download test artifacts
uses: actions/download-artifact@v4
with:
name: asy-testfiles
path: cmake-build-linux/release/
- run: chmod +x cmake-build-linux/release/asy
- name: asy test
run: ctest --test-dir cmake-build-linux/release -R "^asy.*" -E "asy.(gc.*|pic.trans)"
linux-asy-docgen:
runs-on: "ubuntu-22.04"
needs: build-linux-release-x64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/initialize-linux-env
- name: install dependencies
run: sudo apt-get install texlive texlive-latex-extra texinfo ghostscript
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: asy-buildfiles
path: cmake-build-linux/release/
- name: delete cache file
run: rm -f cmake-build-linux/release/CMakeCache.txt
- name: reconfigure with documentation
run: cmake --preset linux/release-ccache
- name: touch asymptote binary (to avoid need for rebuilding)
run: touch cmake-build-linux/release/asy
- name: build documentation
run: cmake --build --preset linux/release-ccache --target docgen -j
- name: Archive asymptote.pdf
uses: actions/upload-artifact@v4
with:
name: asy-pdf-file
path: cmake-build-linux/release/docbuild/asymptote.pdf
- name: Archive remaining asymptote documentation
uses: actions/upload-artifact@v4
with:
name: asy-misc-docs
path: |
cmake-build-linux/release/docbuild/asy-latex.pdf
cmake-build-linux/release/docbuild/asymptote.sty
cmake-build-linux/release/docbuild/CAD.pdf
cmake-build-linux/release/docbuild/asyRefCard.pdf
cmake-build-linux/release/docbuild/TeXShopAndAsymptote.pdf
cmake-build-linux/release/docbuild/latexusage.pdf
package-asymptote-artifacts:
needs: [test-x64-cxxtests, test-x64-asy-tests, linux-asy-docgen]
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: asy-buildfiles
path: tar-stage
- name: Download asymptote.pdf
uses: actions/download-artifact@v4
with:
name: asy-pdf-file
path: tar-stage/doc/
- name: Download remaining documentation files
uses: actions/download-artifact@v4
with:
name: asy-misc-docs
path: tar-stage/doc/
- name: Link examples directory to tar-stage
run: ln -sf ${{ github.workspace }}/examples ${{ github.workspace }}/tar-stage/examples
- name: Set asy's +x flag
run: chmod +x tar-stage/asy
- name: tar package
run: tar -C tar-stage -cvhf asymptote-build-linux.tar asy base examples doc
- name: Archive Asymptote test files
uses: actions/upload-artifact@v4
with:
name: asymptote-build-linux
path: asymptote-build-linux.tar