mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
actions-rs/clippy-check runs clippy with --message-format=json option and converts the output into annotations. This makes clippy output unreadable, it is JSON and you cannot quickly find the line number to fix. Annotations in the code review view look nice, but on large PRs they are less usable because you need to scroll the whole page to find all the annotations.
152 lines
3.8 KiB
YAML
152 lines
3.8 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@v3
|
|
- run: cargo fmt --all -- --check
|
|
|
|
run_clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
override: true
|
|
- name: Cache rust cargo artifacts
|
|
uses: swatinem/rust-cache@v2
|
|
- run: cargo clippy --workspace --tests --examples --benches --features repl -- -D warnings
|
|
|
|
docs:
|
|
name: Rust doc comments
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v3
|
|
- 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@v2
|
|
- name: Rustdoc
|
|
run: cargo doc --document-private-items --no-deps
|
|
|
|
build_and_test:
|
|
name: Build and test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Currently used Rust version.
|
|
- os: ubuntu-latest
|
|
rust: 1.64.0
|
|
python: 3.9
|
|
- os: windows-latest
|
|
rust: 1.64.0
|
|
python: false # Python bindings compilation on Windows is not supported.
|
|
|
|
# Minimum Supported Rust Version = 1.63.0
|
|
#
|
|
# Minimum Supported Python Version = 3.7
|
|
# This is the minimum version for which manylinux Python wheels are
|
|
# built.
|
|
- os: ubuntu-latest
|
|
rust: 1.63.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@v2
|
|
|
|
- name: check
|
|
run: cargo check --all --bins --examples --tests --features repl --benches
|
|
|
|
- name: tests
|
|
run: cargo test --all
|
|
|
|
- name: test cargo vendor
|
|
run: cargo vendor
|
|
|
|
- name: install python
|
|
if: ${{ matrix.python }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- name: install tox
|
|
if: ${{ matrix.python }}
|
|
run: pip install tox
|
|
|
|
- name: build C library
|
|
if: ${{ matrix.python }}
|
|
run: cargo build -p deltachat_ffi --features jsonrpc
|
|
|
|
- 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
|
|
|
|
- name: build deltachat-rpc-server
|
|
if: ${{ matrix.python }}
|
|
run: cargo build -p deltachat-rpc-server
|
|
|
|
- name: add deltachat-rpc-server to path
|
|
if: ${{ matrix.python }}
|
|
run: echo ${{ github.workspace }}/target/debug >> $GITHUB_PATH
|
|
|
|
- name: run deltachat-rpc-client tests
|
|
if: ${{ matrix.python }}
|
|
env:
|
|
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
|
|
working-directory: deltachat-rpc-client
|
|
run: tox -e py3,lint
|
|
|
|
- name: install pypy
|
|
if: ${{ matrix.python }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 'pypy${{ matrix.python }}'
|
|
|
|
- name: run pypy 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 pypy3
|