ci #64
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
name: ci | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
paths: | |
- 'detectors/**' | |
- 'utils/**' | |
- 'Makefile' | |
- 'rustle' | |
- 'rust-toolchain.toml' | |
- '.clang-tidy' | |
pull_request: | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install tools | |
run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" 15 all | |
- name: Lint | |
run: make lint | |
- id: check_file | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: "clang-tidy-fixes.yaml" | |
- name: Upload fix file when something needs to be fixed? | |
uses: actions/upload-artifact@v3 | |
if: steps.check_file.outputs.files_exists == 'true' | |
with: | |
name: clang-tidy-fixes | |
path: clang-tidy-fixes.yaml | |
- name: Exit when something needs to be fixed? | |
if: steps.check_file.outputs.files_exists == 'true' | |
run: exit 1 | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the docker image | |
run: docker build --build-arg UID=`id -u` --build-arg GID=`id -g` -t rustle . | |
- name: Run the Docker image for unit test | |
run: docker run -v `pwd`:/rustle -w /rustle rustle scripts/unit_test.sh | |
unit-test-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install tools | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.67.0 | |
brew install llvm@15 | |
pip3 install -r utils/requirements.txt | |
brew install figlet coreutils gsed | |
cargo install rustfilt | |
- name: Run test | |
run: scripts/unit_test.sh |