Skip to content

Commit

Permalink
Merge pull request #1 from extism/add-ci
Browse files Browse the repository at this point in the history
chore: add ci
  • Loading branch information
zshipko authored Sep 14, 2023
2 parents 605698c + 1780a6e commit 17da690
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/actions/libextism/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on: [workflow_call]

name: libextism

runs:
using: composite
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
repository: extism/extism
path: runtime
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cache Rust environment
uses: Swatinem/rust-cache@v1
- name: Cache libextism
id: cache-libextism
uses: actions/cache@v3
with:
path: runtime/target/**
key: ${{ runner.os }}-libextism-${{ hashFiles('runtime/**') }}
- name: Build
if: steps.cache-libextism.outputs.cache-hit != 'true'
shell: bash
run: |
cd runtime
cargo build --release -p libextism
- name: Install extism shared library
shell: bash
run: |
cd runtime
sudo make install
44 changes: 44 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
pull_request:
workflow_dispatch:

name: Haskell CI

jobs:
test:
name: Haskell
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: ./.github/actions/libextism
- name: Setup Haskell env
uses: haskell/actions/setup@v2
with:
enable-stack: false
- name: 'Set up HLint'
uses: haskell/actions/hlint-setup@v2
- name: Build Haskell Host SDK
run: |
uname -a
cabal update
cabal build
- name: Test Haskell SDK
run: |
LD_LIBRARY_PATH=/usr/local/lib cabal test
- name: 'Run HLint'
uses: haskell/actions/hlint-run@v2
with:
path: src/
fail-on: warning

- name: 'Run HLint'
uses: haskell/actions/hlint-run@v2
with:
path: manifest/
fail-on: warning

0 comments on commit 17da690

Please sign in to comment.