diff --git a/.github/workflows/ci.yml/ci.yml b/.github/workflows/ci.yml/ci.yml new file mode 100644 index 0000000..9da2b4f --- /dev/null +++ b/.github/workflows/ci.yml/ci.yml @@ -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 }}