Skip to content

Forgetful JIT

Forgetful JIT #1042

Workflow file for this run

name: Codon CI
on:
push:
branches:
- master
- develop
tags:
- '*'
pull_request:
branches:
- develop
jobs:
create_release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
permissions:
contents: write
steps:
- name: Create Release
if: contains(github.ref, 'tags/v')
id: create_release
uses: ncipollo/release-action@v1
manylinux:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: linux-x86_64
- os: ubuntu-latest
arch: manylinux2014-x86_64
- os: ubuntu-24.04-arm
arch: linux-aarch64
- os: ubuntu-24.04-arm
arch: manylinux2014-aarch64
- os: macos-13
arch: darwin-x86_64
- os: macos-14
arch: darwin-arm64
runs-on: ${{ matrix.os }}
name: Codon CI (manylinux)
needs: create_release
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Build (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
(cd .github/build-linux && docker build -t local -f Dockerfile.${{ matrix.arch }} .)
docker run -v $(pwd):/github/workspace local /github/workspace ${{ matrix.arch }} yes
- name: Build (macOS)
if: startsWith(matrix.os, 'macos')
run: |
sudo mkdir -p /opt/llvm-codon
sudo chown -R $(whoami) /opt/llvm-codon
curl -L https://github.com/exaloop/llvm-project/releases/download/codon-20.1.7/llvm-codon-20.1.7-${{ matrix.arch }}.tar.bz2 | tar jxf - -C /opt
brew install gcc
bash .github/build-linux/entrypoint.sh ${{ github.workspace }} ${{ matrix.arch }} yes
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: codon-${{ github.ref_name }}-${{ matrix.arch }}.tar.gz
path: codon-${{ matrix.arch }}.tar.gz
# - name: Upload Release Asset
# if: contains(github.ref, 'tags/v')
# uses: actions/upload-release-asset@v1.0.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.create_release.outputs.upload_url }}
# asset_path: ./codon-linux-${{ matrix.arch }}.tar.gz
# asset_name: codon-linux-${{ matrix.arch }}.tar.gz
# asset_content_type: application/gzip
# main:
# strategy:
# matrix:
# os:
# - ubuntu-latest
# - macos-latest
# runs-on: ${{ matrix.os }}
# name: Codon CI
# needs: create_release
# permissions:
# contents: write
# id-token: write
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: '3.9'
# - name: x86_64 Linux Setup
# if: startsWith(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-arm-latest'
# run: |
# sudo apt update
# sudo apt install -y gfortran libgfortran5 lsb-release wget software-properties-common gnupg
# wget https://apt.llvm.org/llvm.sh
# sudo chmod +x llvm.sh
# sudo ./llvm.sh 17
# echo "LIBEXT=so" >> $GITHUB_ENV
# echo "OS_NAME=linux" >> $GITHUB_ENV
# echo "CODON_SYSTEM_LIBRARIES=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
# echo "CC=clang-17" >> $GITHUB_ENV
# echo "CXX=clang++-17" >> $GITHUB_ENV
# - name: Arm Linux Setup
# if: matrix.os == 'ubuntu-arm-latest'
# run: |
# sudo apt update
# sudo apt install -y gfortran libgfortran5 lsb-release wget software-properties-common gnupg
# wget https://apt.llvm.org/llvm.sh
# sudo chmod +x llvm.sh
# sudo ./llvm.sh 17
# echo "LIBEXT=so" >> $GITHUB_ENV
# echo "OS_NAME=linux" >> $GITHUB_ENV
# echo "CODON_SYSTEM_LIBRARIES=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
# echo "CC=clang-17" >> $GITHUB_ENV
# echo "CXX=clang++-17" >> $GITHUB_ENV
# - name: macOS Setup
# if: startsWith(matrix.os, 'macos')
# run: |
# brew install gcc
# echo "LIBEXT=dylib" >> $GITHUB_ENV
# echo "OS_NAME=osx" >> $GITHUB_ENV
# echo "CODON_SYSTEM_LIBRARIES=" >> $GITHUB_ENV
# echo "CC=clang" >> $GITHUB_ENV
# echo "CXX=clang++" >> $GITHUB_ENV
# echo "FC=gfortran-12" >> $GITHUB_ENV
# - name: Set up Python
# run: |
# python -m pip install --upgrade pip setuptools wheel
# python -m pip install cython wheel astunparse
# python -m pip install --force-reinstall -v "numpy==2.0.2"
# which python
# which pip
# echo "CODON_PYTHON=$(python test/python/find-python-library.py)" >> $GITHUB_ENV
# - name: Cache Dependencies
# id: cache-deps
# uses: actions/cache@v4
# with:
# path: llvm
# key: ${{ runner.os }}-${{ matrix.os }}-llvm
# - name: Build Dependencies
# if: steps.cache-deps.outputs.cache-hit != 'true'
# run: ./scripts/deps.sh 2
# - name: Build
# run: |
# mkdir build
# export LLVM_DIR=$(llvm/bin/llvm-config --cmakedir)
# (cd build && cmake .. -DCMAKE_BUILD_TYPE=Release \
# -DCMAKE_C_COMPILER=${CC} \
# -DCMAKE_CXX_COMPILER=${CXX})
# cmake --build build --config Release -- VERBOSE=1
# cmake --install build --prefix=codon-deploy
# - name: Build Cython
# run: |
# (cd codon-deploy/python && python3 setup.py sdist)
# CODON_DIR=$(pwd)/codon-deploy python -m pip install -v codon-deploy/python/dist/*.gz
# CODON_PATH=$(pwd)/codon-deploy/lib/codon/stdlib python test/python/cython_jit.py
# - name: Test
# run: |
# ln -s build/libcodonrt.${LIBEXT} .
# build/codon_test
# test/app/test.sh build
# (cd test/python && CODON_DIR=$(pwd)/../../codon-deploy python3 setup.py build_ext --inplace && python3 pyext.py)
# env:
# CODON_PATH: ./stdlib
# PYTHONPATH: .:./test/python
# LD_LIBRARY_PATH: ./build
# - name: Artifact Environment
# run: |
# echo "CODON_BUILD_ARCHIVE=codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz" >> $GITHUB_ENV
# - name: Codesign (macOS)
# if: startsWith(matrix.os, 'macos')
# run: |
# codesign -f -s - codon-deploy/bin/codon codon-deploy/lib/codon/*.dylib
# - name: Prepare Artifacts
# run: |
# cp -rf codon-deploy/python/dist .
# rm -rf codon-deploy/lib/libfmt.a codon-deploy/lib/pkgconfig codon-deploy/lib/cmake codon-deploy/python/codon_jit.egg-info codon-deploy/python/build
# tar -czf ${CODON_BUILD_ARCHIVE} codon-deploy
# du -sh codon-deploy
# - name: Upload Release Asset
# if: contains(github.ref, 'tags/v') && startsWith(matrix.os, 'macos')
# uses: actions/upload-release-asset@v1.0.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.create_release.outputs.upload_url }}
# asset_path: ./codon-darwin-arm64.tar.gz
# asset_name: codon-darwin-arm64.tar.gz
# asset_content_type: application/gzip
# - name: Upload Artifacts
# if: startsWith(matrix.os, 'macos')
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.os }}-arm64
# path: codon-darwin-arm64.tar.gz
# - name: Upload Artifacts
# if: startsWith(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-arm-latest'
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.os }}-x86_64
# path: codon-linux-x86_64.tar.gz
# - name: Upload Artifacts
# if: matrix.os == 'ubuntu-arm-latest'
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.os }}-arm64
# path: codon-linux-arm64.tar.gz
# - name: Publish Package
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && startsWith(matrix.os, 'ubuntu')
# uses: pypa/gh-action-pypi-publish@release/v1
build_documentation:
name: Build and Publish Documentation
runs-on: ubuntu-latest
needs: manylinux
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
python -m pip install mkdocs \
mkdocs-autorefs \
mkdocs-macros-plugin \
mkdocs-material-extensions \
mkdocs-redirects
sudo apt-get update
sudo apt-get install -y pngquant
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: manylinux-x86_64
path: ./downloaded-artifact
- name: Build API reference
run: |
mv downloaded-artifact/* .
tar -xvzf codon-linux-x86_64.tar.gz && rm codon-linux-x86_64.tar.gz
codon-deploy/bin/codon doc codon-deploy/lib/codon/stdlib > docs.json
python scripts/docgen.py docs.json docs/libraries/api $(pwd)/codon-deploy/lib/codon/stdlib
- name: Build MkDocs site
run: mkdocs build --strict
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
force_orphan: true
cname: docs.exaloop.io