From 13ec93127311e25fcf995cc3967d96cd47cd848b Mon Sep 17 00:00:00 2001 From: skanehira Date: Mon, 1 Jan 2024 14:00:53 +0900 Subject: [PATCH 1/2] chore: add ci (#1) * chore: add ci * fix * fix --- .github/workflows/actions/setup/action.yaml | 17 +++++++++++ .github/workflows/ci.yaml | 31 +++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/actions/setup/action.yaml create mode 100644 .github/workflows/ci.yaml 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 From 78e6f0a358807e798e0b46b216c8d1b4dc2efae1 Mon Sep 17 00:00:00 2001 From: skanehira Date: Mon, 1 Jan 2024 14:25:21 +0900 Subject: [PATCH 2/2] fix: clippy warning --- tests/spec.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 + } } } }