From 5636c4eda632982b6ef6b3f86737bee7d4bc25be Mon Sep 17 00:00:00 2001 From: Keiichi Watanabe Date: Wed, 31 May 2023 13:01:01 +0900 Subject: [PATCH] Add GitHub Actions config (#2) * Add GitHub Actions config * Run `apt update` in GitHub Actions * Add install-deps script * Update install-deps --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ install-deps | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100755 install-deps diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..90cdc8c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Install Dependencies + run: ./install-deps + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + - name: Run doc + run: cargo doc --verbose + - name: Run clippy + run: cargo clippy diff --git a/install-deps b/install-deps new file mode 100755 index 0000000..01bf9ee --- /dev/null +++ b/install-deps @@ -0,0 +1,25 @@ +#!/bin/bash + +sudo apt update +sudo apt install build-essential git pkg-config -y + +# libtraceevent +git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ +cd libtraceevent +make +sudo make install +cd .. + +# libtracefs +git clone https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ +cd libtracefs +make +sudo make install +cd .. + +# libtracecmd +git clone git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git +cd trace-cmd +make +sudo make install_libs +cd ..