Skip to content

Commit

Permalink
ci: disable windows, install extism lib
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Jan 22, 2024
1 parent f4a1764 commit 14726d7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
17 changes: 17 additions & 0 deletions .github/actions/libextism/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on: [workflow_call]

name: libextism

runs:
using: composite
steps:
- uses: actions/checkout@v3
with:
repository: extism/cli
path: .extism-cli
- uses: ./.extism-cli/.github/actions/extism-cli
- name: Install
shell: bash
run: sudo extism lib install --version git
env:
GITHUB_TOKEN: ${{ github.token }}
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:
include:
- name: Linux
os: ubuntu-latest
- name: Windows
os: windows-latest
# - name: Windows
# os: windows-latest
- name: macOS
os: macos-latest

name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/libextism
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Setup elan toolchain on Linux or macOS
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
Expand All @@ -30,14 +33,14 @@ jobs:
echo "Adding location $HOME/.elan/bin to PATH..."
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: Setup elan toolchain on Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
curl -O --location https://raw.githubusercontent.com/leanprover/elan/master/elan-init.ps1
.\elan-init.ps1 -NoPrompt 1 -DefaultToolchain leanprover/lean4:nightly
echo "Adding location $HOME\.elan\bin to PATH..."
echo "$HOME\.elan\bin" >> $env:GITHUB_PATH
# - name: Setup elan toolchain on Windows
# if: matrix.os == 'windows-latest'
# shell: pwsh
# run: |
# curl -O --location https://raw.githubusercontent.com/leanprover/elan/master/elan-init.ps1
# .\elan-init.ps1 -NoPrompt 1 -DefaultToolchain leanprover/lean4:nightly
# echo "Adding location $HOME\.elan\bin to PATH..."
# echo "$HOME\.elan\bin" >> $env:GITHUB_PATH

- name: Test elan & lean are working
run: |
Expand Down
7 changes: 5 additions & 2 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import Lake

open Lake DSL

def extismIncludePath := "/usr/local/include"
def extismLibPath := "/usr/local/lib"

package extism {
-- precompileModules := true
moreLinkArgs := #["-lextism"]
moreLinkArgs := #["-L" ++ extismLibPath, "-lextism"]
}

lean_lib Extism
Expand All @@ -18,7 +21,7 @@ lean_exe test {
target bindings.o pkg : FilePath := do
let oFile := pkg.buildDir / "c" / "bindings.o"
let srcJob ← inputFile <| pkg.dir / "c" / "bindings.c"
let weakArgs := #["-I", (← getLeanIncludeDir).toString, "-I", "/usr/local/include"]
let weakArgs := #["-I", (← getLeanIncludeDir).toString, "-I", extismIncludePath]
buildO "bindings.c" oFile srcJob weakArgs #["-fPIC", "--std=c11"] "cc" getLeanTrace

extern_lib libleanextism pkg := do
Expand Down

0 comments on commit 14726d7

Please sign in to comment.