-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add macos build and test github actions and refine windows …
…and ubuntu github actions.
- Loading branch information
Showing
6 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: build-and-test-macos | ||
on: ["push", "pull_request"] | ||
jobs: | ||
build-and-test: | ||
# Ref: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md | ||
runs-on: macos-11 | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: 'true' | ||
|
||
- run: clang --version | ||
- run: cargo --version | ||
- run: rustc --print sysroot | ||
|
||
- name: Build KCLVM | ||
run: make build | ||
shell: bash | ||
- name: Grammar test | ||
run: | | ||
brew install coreutils | ||
chmod +x ./internal/kclvm_py/scripts/test_grammar.sh | ||
./internal/kclvm_py/scripts/test_grammar.sh | ||
shell: bash | ||
- name: Internal python unit test | ||
run: | | ||
chmod +x ./internal/kclvm_py/scripts/test_unit.sh | ||
./internal/kclvm_py/scripts/test_unit.sh | ||
shell: bash | ||
- name: Delete rust cargo | ||
run: rm -rf /root/.cargo/bin | ||
shell: bash | ||
- name: Install LLVM 12 | ||
run: brew install llvm@12 | ||
shell: bash | ||
- name: Install rust nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.61 | ||
override: true | ||
components: clippy, rustfmt | ||
- name: Rust grammar test | ||
working-directory: ./kclvm | ||
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make test-grammar | ||
shell: bash | ||
- name: Rust runtime test | ||
working-directory: ./kclvm | ||
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make test-runtime | ||
shell: bash | ||
- name: Rust unit test | ||
working-directory: ./kclvm | ||
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make codecov-lcov | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Environment | ||
if [ -f "/etc/os-release" ]; then | ||
source /etc/os-release | ||
os=$ID | ||
else | ||
os=$(uname) | ||
fi | ||
topdir=$(realpath $(dirname $0)/../../../) | ||
kclvm_install_dir="$topdir/_build/dist/$os/kclvm" | ||
kclvm_source_dir="$topdir" | ||
|
||
echo PATH=$PATH:$kclvm_source_dir/_build/dist/ubuntu/kclvm/bin >> ~/.bash_profile | ||
echo PATH=$PATH:$kclvm_source_dir/_build/dist/$os/kclvm/bin >> ~/.bash_profile | ||
source ~/.bash_profile | ||
|
||
export PATH=$PATH:$topdir/_build/dist/$os/kclvm/bin | ||
|
||
# Grammar test | ||
cd $kclvm_source_dir/test/grammar | ||
kclvm -m pytest -v -n 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters