Skip to content

Specify Ubuntu 22.04 as the CI environment #115

Specify Ubuntu 22.04 as the CI environment

Specify Ubuntu 22.04 as the CI environment #115

Workflow file for this run

# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: linter and test
on:
# will be triggered on PR events
pull_request:
types:
- opened
- synchronize
paths:
- ".github/**"
- "crates/**"
- "src/**"
push:
branches:
- main
- "dev/**"
paths:
- "crates/**"
- "src/**"
# allow to be triggered manually
workflow_dispatch:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"
jobs:
# linter
clippy_check:
runs-on: ubuntu-latest
steps:
- name: install dependencies (source code)
run: |
if [[ -d /usr/lib/llvm-15 ]]; then
echo "LLVM 15 is already installed"
else
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
tar xfv ./clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
sudo mv ./clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04 /usr/lib/llvm-15
fi
working-directory: /
- uses: actions/checkout@v4
with:
submodules: true
- name: Run Clippy
run: |
cargo clippy --all-targets --all-features
# all test cases with default features
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Run test cases
run: cargo test --lib
- name: Run test cases sequentially
run: cargo test --lib -- --ignored --test-threads 1