diff --git a/.github/workflows/actions/setup/action.yaml b/.github/workflows/actions/setup/action.yaml new file mode 100644 index 0000000..7c3d637 --- /dev/null +++ b/.github/workflows/actions/setup/action.yaml @@ -0,0 +1,17 @@ +name: Setup + +runs: + using: composite + steps: + - name: Setup rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Install LLVM + shell: bash + run: | + export LLVM_URL=https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0/clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4.tar.xz + sudo mkdir -p /usr/local/llvm \ + && sudo wget ${LLVM_URL} -O /tmp/llvm.tar.xz \ + && sudo tar -xvf /tmp/llvm.tar.xz -C /usr/local/llvm \ + && sudo rm /tmp/llvm.tar.xz + echo "/usr/local/llvm/bin" >> $GITHUB_PATH + echo "LLVM_SYS_150_PREFIX=/usr/local/llvm/clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4" >> $GITHUB_ENV diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..e827d41 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,31 @@ +name: ci +on: + push: + branches: + - main + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' +jobs: + lint: + runs-on: ubuntu-latest + name: Run clippy + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup + uses: ./.github/workflows/actions/setup + - name: Run clippy + run: cargo clippy --all-targets --all-features -- -D warnings + test: + runs-on: ubuntu-latest + name: Run test + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup + uses: ./.github/workflows/actions/setup + - name: Run test + run: cargo test --all -- --nocapture diff --git a/tests/spec.rs b/tests/spec.rs index 04532b9..11d8e4c 100644 --- a/tests/spec.rs +++ b/tests/spec.rs @@ -33,8 +33,9 @@ fn run_spec_test(testname: &str) { println!("Compile Module {:?}", name); compiler::compile_wasm(&module_binary).expect("compile failed"); } - // TODO: support assertion - _ => {} + _ => { + // TODO: support assertion + } } } }