Skip to content

Commit

Permalink
Response to review
Browse files Browse the repository at this point in the history
TODO Fill this in when done
  • Loading branch information
elken committed Jan 23, 2025
1 parent 0f98e33 commit 3002be6
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 55 deletions.
41 changes: 16 additions & 25 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,30 @@ outputs:
runs:
using: "composite"
steps:
- name: Install brew packages
working-directory: ${{ github.workspace }}/compiler+runtime
shell: bash
run: |
if [[ "$OSTYPE" == "linux"* ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
sudo apt-get install -y libzip-dev libbz2-dev libgc-dev
fi
HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja libzip doctest boost llvm@19 double-conversion bdw-gc clang-format
- name: Compile and test
shell: bash
working-directory: ${{ github.workspace }}/compiler+runtime
run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
fi
./bin/ci/test
# if [[ "$OSTYPE" == "darwin"* ]]; then
# export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
# fi
if [[ "$OSTYPE" == "linux"* ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
# if [[ "$OSTYPE" == "linux"* ]]; then
# eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# fi
export PATH="$(brew --prefix)/opt/llvm/bin:${PATH}"
export LDFLAGS="-Wl,-rpath,$(brew --prefix)/opt/llvm/lib ${LDFLAGS}"
export CPPFLAGS="-I$(brew --prefix)/opt/llvm/include ${CPPFLAGS}"
# export PATH="$(brew --prefix)/opt/llvm/bin:${PATH}"
# export LDFLAGS="-Wl,-rpath,$(brew --prefix)/opt/llvm/lib ${LDFLAGS}"
# export CPPFLAGS="-I$(brew --prefix)/opt/llvm/include ${CPPFLAGS}"
${{ github.workspace }}/compiler+runtime/bin/configure -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} #\
#-Djank_tests=on \
# -Djank_analysis="${ANALYSIS:-off}" \
# -Djank_coverage="${COVERAGE:-off}"
# ${{ github.workspace }}/compiler+runtime/bin/configure -GNinja \
# -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} #\
# #-Djank_tests=on \
# # -Djank_analysis="${ANALYSIS:-off}" \
# # -Djank_coverage="${COVERAGE:-off}"
${{ github.workspace }}/compiler+runtime/bin/compile
# ${{ github.workspace }}/compiler+runtime/bin/compile
# ${{ github.workspace }}/compiler+runtime/bin/test
# LLVM_PROFILE_FILE=build/test.profraw ./bin/test
# llvm-profdata merge --sparse build/test.profraw -o build/test.profdata
Expand Down
54 changes: 36 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,51 @@ on:
push:

jobs:
test:
linux:
strategy:
matrix:
build_type: [ Debug, Release ]
runs-on: ubuntu-latest
container: ubuntu:24.10
env:
CC: clang-19
CXX: clang++-19
timeout-minutes: 240
steps:
- name: Install deps
run: apt update && apt install -y git git-lfs sudo build-essential libzip-dev libbz2-dev libgc-dev clang-19 libboost-all-dev ninja-build doctest-dev cmake libllvmlibc-19-dev libclang-19-dev libssl-dev
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build and test
uses: ./.github/actions/build
id: build
with:
update_release: ${{ github.ref == 'refs/heads/main' && matrix.build_type == 'Release' }}
- name: Update latest release
if: success() && github.ref == 'refs/heads/main' && ${{ matrix.build_type == 'Release' }}
uses: softprops/action-gh-release@v2
with:
tag_name: latest
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ steps.build.outputs.release_archive }}

macos:
strategy:
fail-fast: false
matrix:
# TODO: sanitize: [On, Off]
os: [ macos-15]
os: [ macos-13, macos-15 ]
# TODO: Enable release once we no longer have a Clang crash:
# https://github.com/jank-lang/jank/actions/runs/12269972895/job/34234432107
build_type: [Debug]
include:
- os: ubuntu-24.04
cc: clang
cxx: clang++
- os: macos-13
cc: clang
cxx: clang++
- os: macos-15
cc: clang
cxx: clang++
build_type: [Debug, Release]
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CODECOV: ${{ matrix.codecov }}
ANALYSIS: ${{ matrix.analysis }}
CC: clang
CXX: clang++
timeout-minutes: 240 # 4h
steps:
- name: Install dependencies
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja libzip doctest boost llvm@19 double-conversion bdw-gc clang-format
- uses: actions/checkout@v4
with:
submodules: recursive
Expand Down
34 changes: 22 additions & 12 deletions compiler+runtime/bin/ci/test
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
#!/usr/bin/env bash

set -eu
set -e
if [[ "$OSTYPE" == "darwin"* ]];
then
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export PATH="$(brew --prefix)/opt/llvm/bin:${PATH}"
export LDFLAGS="-Wl,-rpath,$(brew --prefix)/opt/llvm/lib ${LDFLAGS}"
export CPPFLAGS="-I$(brew --prefix)/opt/llvm/include ${CPPFLAGS}"
fi

llvm_dir="${PWD}/build/llvm-install"
if [[ ! -d "${llvm_dir}" ]];
if [[ "${BUILD_LLVM:-off}" == "on" ]];
then
mkdir -p build
pushd build
../bin/build-clang
popd
llvm_dir="${PWD}/build/llvm-install"
if [[ ! -d "${llvm_dir}" ]];
then
mkdir -p build
pushd build
../bin/build-clang
popd
fi
export CC="${llvm_dir}/usr/local/bin/clang"
export CXX="${llvm_dir}/usr/local/bin/clang++"
fi
export CC="${llvm_dir}/usr/local/bin/clang"
export CXX="${llvm_dir}/usr/local/bin/clang++"

./bin/configure -GNinja \
-Djank_local_clang=on \
-Djank_local_clang="${BUILD_LLVM:-off}" \
-Djank_tests=on \
-Djank_analysis="${ANALYSIS:-off}" \
"$@"
Expand All @@ -29,8 +39,8 @@ then
-Djank_analysis=off \
"$@"
LLVM_PROFILE_FILE=build/test.profraw ./bin/test
"${llvm_dir}/usr/local/bin/llvm-profdata" merge --sparse build/test.profraw -o build/test.profdata
"${llvm_dir}/usr/local/bin/llvm-cov" show ./build/jank-test --instr-profile build/test.profdata > coverage.txt
"${llvm_dir:-/}/usr/local/bin/llvm-profdata" merge --sparse build/test.profraw -o build/test.profdata
"${llvm_dir:-/}/usr/local/bin/llvm-cov" show ./build/jank-test --instr-profile build/test.profdata > coverage.txt
# This file will be read by a subsequent CodeCov Github action.
else
./bin/test
Expand Down

0 comments on commit 3002be6

Please sign in to comment.