mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
This runs all CI jobs with -Dwarnings, turning warnings into errors for CI. This is useful since we run rustfmt and clippy on CI on stable rust, while the builds and tests run with a specific older rustc. The latter is also used for local development usually since it is encoded in the rust-toolchain file. This warnings in clippy jobs of stable rust would often go unnoticed, however stable rust usually finds more genuine issues than the older compiler we use.
144 lines
3.5 KiB
YAML
144 lines
3.5 KiB
YAML
name: Rust CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
- staging
|
|
- trying
|
|
|
|
env:
|
|
RUSTFLAGS: -Dwarnings
|
|
|
|
jobs:
|
|
|
|
fmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- run: rustup component add rustfmt
|
|
- name: Cache rust cargo artifacts
|
|
uses: swatinem/rust-cache@v1
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
|
|
run_clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
override: true
|
|
- name: Cache rust cargo artifacts
|
|
uses: swatinem/rust-cache@v1
|
|
- uses: actions-rs/clippy-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: --workspace --tests --examples
|
|
|
|
docs:
|
|
name: Rust doc comments
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
- name: Install rust stable toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
components: rust-docs
|
|
override: true
|
|
- name: Cache rust cargo artifacts
|
|
uses: swatinem/rust-cache@v1
|
|
- name: Rustdoc
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: doc
|
|
args: --document-private-items --no-deps
|
|
|
|
build_and_test:
|
|
name: Build and test
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# Currently used Rust version, same as in `rust-toolchain` file.
|
|
- os: ubuntu-latest
|
|
rust: 1.54.0
|
|
python: 3.9
|
|
- os: windows-latest
|
|
rust: 1.54.0
|
|
python: false # Python bindings compilation on Windows is not supported.
|
|
|
|
# Minimum Supported Rust Version = 1.51.0
|
|
#
|
|
# Minimum Supported Python Version = 3.7
|
|
# This is the minimum version for which manylinux Python wheels are
|
|
# built.
|
|
- os: ubuntu-latest
|
|
rust: 1.51.0
|
|
python: 3.7
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
|
|
- name: Install ${{ matrix.rust }}
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
override: true
|
|
|
|
- name: Cache rust cargo artifacts
|
|
uses: swatinem/rust-cache@v1
|
|
|
|
- name: check
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: check
|
|
args: --all --bins --examples --tests --features repl --benches
|
|
|
|
- name: tests
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --all
|
|
|
|
- name: install python
|
|
if: ${{ matrix.python }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- name: install tox
|
|
if: ${{ matrix.python }}
|
|
run: pip install tox
|
|
|
|
- name: build C library
|
|
if: ${{ matrix.python }}
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: -p deltachat_ffi
|
|
|
|
- name: run python tests
|
|
if: ${{ matrix.python }}
|
|
env:
|
|
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
|
|
DCC_RS_TARGET: debug
|
|
DCC_RS_DEV: ${{ github.workspace }}
|
|
working-directory: python
|
|
run: tox -e lint,mypy,doc,py3
|