From 501cf5d93be5eaf5899b53757637fef4ae0b93ed Mon Sep 17 00:00:00 2001 From: Alexey Vishnyakov Date: Sun, 17 Sep 2023 11:09:58 +0300 Subject: [PATCH] Split CI in multiple workflows --- .github/workflows/aarch64.yml | 36 ++++++++++++ .github/workflows/amd64.yml | 30 ++++++++++ .github/workflows/fuzzing.yml | 27 +++++++++ .github/workflows/lint.yml | 21 +++++++ .github/workflows/main.yml | 103 ---------------------------------- .github/workflows/riscv64.yml | 36 ++++++++++++ 6 files changed, 150 insertions(+), 103 deletions(-) create mode 100644 .github/workflows/aarch64.yml create mode 100644 .github/workflows/amd64.yml create mode 100644 .github/workflows/fuzzing.yml create mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/riscv64.yml diff --git a/.github/workflows/aarch64.yml b/.github/workflows/aarch64.yml new file mode 100644 index 00000000..954e6a72 --- /dev/null +++ b/.github/workflows/aarch64.yml @@ -0,0 +1,36 @@ +name: aarch64 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always +jobs: + ubuntu-latest: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: uraimo/run-on-arch-action@v2 + name: Build and Run Tests + with: + arch: aarch64 + distro: ubuntu_latest + dockerRunArgs: | + --privileged + install: | + export CARGO_TERM_COLOR=always + export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + apt-get update && apt-get install -y gdb pip curl python3.10-dev clang llvm build-essential + curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ + ./rustup.sh -y && rm rustup.sh + run: | + export PATH=/root/.cargo/bin:$PATH + export CARGO_TERM_COLOR=always + export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + cargo build --all-features --release --verbose + cargo test --release --verbose diff --git a/.github/workflows/amd64.yml b/.github/workflows/amd64.yml new file mode 100644 index 00000000..98c11d47 --- /dev/null +++ b/.github/workflows/amd64.yml @@ -0,0 +1,30 @@ +name: amd64 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always +jobs: + ubuntu-latest: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --all-features --verbose + - name: Run tests + run: | + sudo apt update && sudo apt install -y gdb pip curl python3.10-dev llvm \ + openjdk-17-jdk + pip3 install atheris + curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ + ./rustup.sh -y && rm rustup.sh + rustup install nightly + export PATH=/root/.cargo/bin:$PATH + cargo install cargo-fuzz + cargo test --release --verbose diff --git a/.github/workflows/fuzzing.yml b/.github/workflows/fuzzing.yml new file mode 100644 index 00000000..2db4fd9d --- /dev/null +++ b/.github/workflows/fuzzing.yml @@ -0,0 +1,27 @@ +name: fuzzing + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always +jobs: + ubuntu-latest: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Fuzzing + run: | + curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ + ./rustup.sh -y && rm rustup.sh + rustup install nightly + export PATH=/root/.cargo/bin:$PATH + cargo install cargo-fuzz + cd libcasr/fuzz + mkdir corpus + cargo +nightly fuzz run parse_stacktrace corpus init_corpus -- -max_total_time=600 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..0927f58c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: lint + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always +jobs: + ubuntu-latest: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Code Style + run: cargo fmt -- --check + - name: Clippy + run: RUSTFLAGS="-Dwarnings" cargo clippy --all-features --all --tests diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 4cd733ba..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always -jobs: - ubuntu: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Code Style - run: cargo fmt -- --check - - name: Clippy - run: RUSTFLAGS="-Dwarnings" cargo clippy --all-features --all --tests - - name: Build - run: cargo build --all-features --verbose - - name: Run tests - run: | - sudo apt update && sudo apt install -y gdb pip curl python3.10-dev llvm \ - openjdk-17-jdk - pip3 install atheris - curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ - ./rustup.sh -y && rm rustup.sh - rustup install nightly - export PATH=/root/.cargo/bin:$PATH - cargo install cargo-fuzz - cargo test --release --verbose - - ubuntu-fuzz: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Fuzzing - run: | - curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ - ./rustup.sh -y && rm rustup.sh - rustup install nightly - export PATH=/root/.cargo/bin:$PATH - cargo install cargo-fuzz - cd libcasr/fuzz - mkdir corpus - cargo +nightly fuzz run parse_stacktrace corpus init_corpus -- -max_total_time=600 - - ubuntu-aarch64: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: uraimo/run-on-arch-action@v2 - name: Build and Run Tests - with: - arch: aarch64 - distro: ubuntu_latest - dockerRunArgs: | - --privileged - install: | - export CARGO_TERM_COLOR=always - export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse - apt-get update && apt-get install -y gdb pip curl python3.10-dev clang llvm build-essential - curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ - ./rustup.sh -y && rm rustup.sh - run: | - export PATH=/root/.cargo/bin:$PATH - export CARGO_TERM_COLOR=always - export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse - cargo build --all-features --release --verbose - cargo test --release --verbose - - ubuntu-riscv64: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: uraimo/run-on-arch-action@v2 - name: Build and Run Tests - with: - arch: riscv64 - distro: ubuntu_latest - dockerRunArgs: | - --privileged - install: | - export CARGO_TERM_COLOR=always - export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse - apt-get update && apt-get install -y gdb pip curl python3.10-dev clang llvm build-essential - curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ - ./rustup.sh -y && rm rustup.sh - run: | - export PATH=/root/.cargo/bin:$PATH - export CARGO_TERM_COLOR=always - export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse - cargo build --release --verbose - cargo test --release --verbose diff --git a/.github/workflows/riscv64.yml b/.github/workflows/riscv64.yml new file mode 100644 index 00000000..1ce18815 --- /dev/null +++ b/.github/workflows/riscv64.yml @@ -0,0 +1,36 @@ +name: riscv64 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always +jobs: + ubuntu-latest: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: uraimo/run-on-arch-action@v2 + name: Build and Run Tests + with: + arch: riscv64 + distro: ubuntu_latest + dockerRunArgs: | + --privileged + install: | + export CARGO_TERM_COLOR=always + export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + apt-get update && apt-get install -y gdb pip curl python3.10-dev clang llvm build-essential + curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \ + ./rustup.sh -y && rm rustup.sh + run: | + export PATH=/root/.cargo/bin:$PATH + export CARGO_TERM_COLOR=always + export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + cargo build --release --verbose + cargo test --release --verbose