diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8274ede16..bff0d5bf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,8 @@ env: VAMPIRREPO: anoma/vamp-ir VAMPIRVERSION: v0.1.3 CAIRO_VM_VERSION: ae06ba04f3b6864546b6baeeebf1b0735ddccb5d + JUST_ARGS: enableOptimized=yes runtimeCcArg=$CC runtimeLibtoolArg=$LIBTOOL + STACK_BUILD_ARGS: --pedantic -j4 --ghc-options=-j jobs: pre-commit: @@ -58,6 +60,8 @@ jobs: build-and-test-linux: runs-on: ubuntu-22.04 steps: + - uses: extractions/setup-just@v2 + - name: Checkout our repository uses: actions/checkout@v3 with: @@ -158,7 +162,7 @@ jobs: - name: Make runtime run: | cd main - make runtime + just ${{ env.JUST_ARGS }} build runtime # We use the options: # - -fhide-source-paths @@ -176,9 +180,10 @@ jobs: - name: Stack setup id: stack - uses: freckle/stack-action@v4 + uses: freckle/stack-action@v5 with: working-directory: main + stack-build-arguments: ${{ env.STACK_BUILD_ARGS }} test: false - name: Install and test Juvix @@ -186,8 +191,8 @@ jobs: if: ${{ success() }} run: | cd main - make install - make test + just ${{ env.JUST_ARGS }} install + just ${{ env.JUST_ARGS }} test - name: Typecheck and format Juvix examples if: ${{ success() }} @@ -225,6 +230,8 @@ jobs: build-and-test-macos: runs-on: macos-12 steps: + - uses: extractions/setup-just@v2 + - name: Checkout our repository uses: actions/checkout@v3 with: @@ -354,7 +361,7 @@ jobs: - name: Make runtime run: | cd main - make CC=$CC LIBTOOL=$LIBTOOL runtime + just ${{ env.JUST_ARGS }} build runtime # We use the options: # - -fhide-source-paths @@ -372,9 +379,10 @@ jobs: - name: Stack setup id: stack - uses: freckle/stack-action@v4 + uses: freckle/stack-action@v5 with: working-directory: main + stack-build-arguments: ${{ env.STACK_BUILD_ARGS }} test: false - name: Add homebrew clang to the PATH (macOS) @@ -399,8 +407,8 @@ jobs: if: ${{ success() }} run: | cd main - make CC=$CC LIBTOOL=$LIBTOOL install - make CC=$CC LIBTOOL=$LIBTOOL test + just ${{ env.JUST_ARGS }} install + just ${{ env.JUST_ARGS }} test - name: Typecheck and format Juvix examples if: ${{ success() }} diff --git a/justfile b/justfile index a1fb6eca9..9a030d32c 100644 --- a/justfile +++ b/justfile @@ -22,6 +22,17 @@ stack := "stack" # the command used to run ormolu ormolu := "ormolu" +# The CC argument to the runtime Makefile +runtimeCcArg := '' + +# The LIBTOOL argument to the runtime Makefile +runtimeLibtoolArg := '' + +# The flags used in the runtime make commands +runtimeCcFlag := if runtimeCcArg == '' { '' } else { "CC=" + runtimeCcArg } +runtimeLibtoolFlag := if runtimeLibtoolArg == '' { '' } else { "LIBTOOL=" + runtimeLibtoolArg } +runtimeArgs := trim(runtimeCcFlag + ' ' + runtimeLibtoolFlag) + # flags used in the stack command stackOptFlag := if enableOptimized == '' { '--fast' } else { '' } # The ghc `-j` flag defaults to number of cpus when no argument is passed @@ -93,7 +104,7 @@ run-profile +cmd: # Build the juvix runtime _buildRuntime: - cd runtime && make -j 4 -s + cd runtime && make {{ runtimeArgs }} -j 4 -s # Build the project. `build runtime` builds only the runtime. [no-exit-message] @@ -104,10 +115,10 @@ build *opts: case $opts in runtime) - just _buildRuntime + just runtimeArgs="{{ runtimeArgs }}" _buildRuntime ;; *) - just _buildRuntime + just runtimeArgs="{{ runtimeArgs }}" _buildRuntime set -x {{ stack }} build {{ stackArgs }} ;;