chore(ci): add Continuous Integration workflow

This commit is contained in:
Orhun Parmaksız 2021-11-24 23:39:03 +03:00
parent 0c223c0a72
commit fdaeaf1160
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

72
.github/workflows/ci.yml/ci.yml vendored Normal file
View file

@ -0,0 +1,72 @@
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * 0"
jobs:
build:
name: Build for ${{ matrix.TARGET }} using Rust ${{ matrix.TOOLCHAIN }} (on ${{ matrix.OS }})
runs-on: ${{ matrix.OS }}
strategy:
fail-fast: false
matrix:
OS: [ubuntu-latest]
TOOLCHAIN: [stable, nightly]
TARGET:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- armv5te-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.TOOLCHAIN }}
target: ${{ matrix.TARGET }}
override: true
components: rustfmt, clippy
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target ${{ matrix.TARGET }}
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Check lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
audit:
name: Perform audit for security
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Run cargo-audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}