Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add ci #1

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading