From 626a8ad4d3f282642b97976a8dd34da119431bd8 Mon Sep 17 00:00:00 2001 From: peefy Date: Sat, 14 Sep 2024 11:49:56 +0800 Subject: [PATCH] ci: add windows mingw test Signed-off-by: peefy --- .github/workflows/mingw_test.yaml | 33 +++++++++++++++++++++++++++++++ kclvm/Cargo.toml | 4 +--- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/mingw_test.yaml diff --git a/.github/workflows/mingw_test.yaml b/.github/workflows/mingw_test.yaml new file mode 100644 index 000000000..26292130e --- /dev/null +++ b/.github/workflows/mingw_test.yaml @@ -0,0 +1,33 @@ +name: build-and-test-windows-mingw +on: ["push", "pull_request"] +jobs: + build-and-test: + name: build and test on windows mingw + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + with: + submodules: "true" + + - name: Install rust nightly toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.79 + override: true + components: clippy, rustfmt + + - run: C:\msys64\usr\bin\pacman.exe -S --needed mingw-w64-x86_64-gcc --noconfirm + - shell: pwsh + run: echo "C:\msys64\mingw64\bin" >> $Env:GITHUB_PATH + + - working-directory: ./kclvm + run: | + rustup target add x86_64-pc-windows-gnu + cargo build -r --target x86_64-pc-windows-gnu + + - uses: actions/upload-artifact@v4 + with: + name: kcl-windows-mingw + if-no-files-found: error + path: kclvm/target/x86_64-pc-windows-gnu/libkclvm_cli_cdylib.a diff --git a/kclvm/Cargo.toml b/kclvm/Cargo.toml index b0b71b64a..248916ec7 100644 --- a/kclvm/Cargo.toml +++ b/kclvm/Cargo.toml @@ -6,9 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] -crate-type = [ - "cdylib", -] +crate-type = ["cdylib", "staticlib"] path = "src/lib.rs" name = "kclvm_cli_cdylib"