From fdcbd4e765ff63d1874d20ef30ae692bd2e42b08 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 21 Jul 2022 09:47:27 +0300 Subject: [PATCH] ci: configure build phase --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c0fe300 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: Build + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + strategy: + matrix: + os: ["ubuntu-latest"] + rust: + - stable + - beta + - nightly + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} + + - name: Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + + - name: Build + run: cargo build --verbose + + - uses: isbang/compose-action@v0.1 + + - name: Run tests + uses: action-rs/cargo@v1 + with: + command: test + args: --all-features --release +