name: Github CI - Development
on:
push:
branches: [ develop, master ]
jobs:
setup-and-build:
name: Setup and build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: ๐ Check out the repository
uses: actions/checkout@v4.1.1
- name: ๐ฆ Cache Rust toolchain
uses: Swatinem/rust-cache@v2
with:
prefix-key: rust-toolchain-
- name: ๐ ๏ธ Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: โ
Check with Clippy linter
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: ๐ Format code with Cargo formatter
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: ๐ฆ Install Rust dependencies and build library
uses: actions-rs/cargo@v1
with:
command: build
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
needs: setup-and-build
permissions:
contents: read
services:
hello-world:
image: hello-world
steps:
- name: ๐ Check out the repository
uses: actions/checkout@v4.1.1
- name: ๐ฆ Cache Rust toolchain
uses: Swatinem/rust-cache@v2
with:
prefix-key: rust-toolchain-
- name: ๐ ๏ธ Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: ๐งช Run integration tests
uses: actions-rs/cargo@v1
with:
command: test
args: -- --test-threads=1