mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
ci: split CI into more parallel jobs
With this, all the builds happen in parallel in 3-6 minutes, and then python tests run for 8-9 minutes. Before, it was 6-17 minutes for compilation, then 19-31 minutes for python tests. Compilation of the library and test binary was not parallelized, and then python tests included async python tests and deltachat-rpc-server binary compilation. Now, deltachat-rpc-server compilation, Rust testing and async python tests are separate jobs.
This commit is contained in:
104
.github/workflows/ci.yml
vendored
104
.github/workflows/ci.yml
vendored
@@ -16,11 +16,11 @@ env:
|
|||||||
RUSTFLAGS: -Dwarnings
|
RUSTFLAGS: -Dwarnings
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint_rust:
|
||||||
name: Rustfmt and Clippy
|
name: Lint Rust
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RUSTUP_TOOLCHAIN: 1.68.0
|
RUSTUP_TOOLCHAIN: 1.68.2
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install rustfmt and clippy
|
- name: Install rustfmt and clippy
|
||||||
@@ -31,6 +31,8 @@ jobs:
|
|||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
run: scripts/clippy.sh
|
run: scripts/clippy.sh
|
||||||
|
- name: Check
|
||||||
|
run: cargo check --workspace --bins --examples --tests --benches
|
||||||
|
|
||||||
cargo_deny:
|
cargo_deny:
|
||||||
name: cargo deny
|
name: cargo deny
|
||||||
@@ -64,12 +66,11 @@ jobs:
|
|||||||
- name: Rustdoc
|
- name: Rustdoc
|
||||||
run: cargo doc --document-private-items --no-deps
|
run: cargo doc --document-private-items --no-deps
|
||||||
|
|
||||||
c_library:
|
rust_tests:
|
||||||
name: Rust tests and C library build
|
name: Rust tests
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
# Currently used Rust version.
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
rust: 1.68.2
|
rust: 1.68.2
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
@@ -95,26 +96,56 @@ jobs:
|
|||||||
- name: Cache rust cargo artifacts
|
- name: Cache rust cargo artifacts
|
||||||
uses: swatinem/rust-cache@v2
|
uses: swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Check
|
|
||||||
run: cargo check --workspace --bins --examples --tests --benches
|
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: cargo test --workspace
|
run: cargo test --workspace
|
||||||
|
|
||||||
- name: Test cargo vendor
|
- name: Test cargo vendor
|
||||||
run: cargo vendor
|
run: cargo vendor
|
||||||
|
|
||||||
|
c_library:
|
||||||
|
name: Build C library
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Cache rust cargo artifacts
|
||||||
|
uses: swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Build C library
|
- name: Build C library
|
||||||
run: cargo build -p deltachat_ffi --features jsonrpc
|
run: cargo build -p deltachat_ffi --features jsonrpc
|
||||||
|
|
||||||
- name: Upload C library
|
- name: Upload C library
|
||||||
if: matrix.os != 'windows-latest'
|
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.os }}-${{matrix.rust}}-libdeltachat.a
|
name: ${{ matrix.os }}-${{matrix.rust}}-libdeltachat.a
|
||||||
path: target/debug/libdeltachat.a
|
path: target/debug/libdeltachat.a
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
rpc_server:
|
||||||
|
name: Build deltachat-rpc-server
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Cache rust cargo artifacts
|
||||||
|
uses: swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Build deltachat-rpc-server
|
||||||
|
run: cargo build -p deltachat-rpc-server
|
||||||
|
|
||||||
|
- name: Upload deltachat-rpc-server
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }}-${{matrix.rust}}-deltachat-rpc-server
|
||||||
|
path: target/debug/deltachat-rpc-server
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
python_lint:
|
python_lint:
|
||||||
name: Python lint
|
name: Python lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -142,26 +173,22 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
# Currently used Rust version.
|
# Currently used Rust version.
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
rust: 1.68.2
|
|
||||||
python: 3.11
|
python: 3.11
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
rust: 1.68.2
|
|
||||||
python: 3.11
|
python: 3.11
|
||||||
|
|
||||||
# PyPy tests
|
# PyPy tests
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
rust: 1.68.2
|
|
||||||
python: pypy3.9
|
python: pypy3.9
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
rust: 1.68.2
|
|
||||||
python: pypy3.9
|
python: pypy3.9
|
||||||
|
|
||||||
# Minimum Supported Python Version = 3.7
|
# Minimum Supported Python Version = 3.7
|
||||||
# This is the minimum version for which manylinux Python wheels are
|
# This is the minimum version for which manylinux Python wheels are
|
||||||
# built. Test it with minimum supported Rust version.
|
# built. Test it with minimum supported Rust version.
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
rust: 1.65.0
|
|
||||||
python: 3.7
|
python: 3.7
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -188,8 +215,51 @@ jobs:
|
|||||||
working-directory: python
|
working-directory: python
|
||||||
run: tox -e mypy,doc,py
|
run: tox -e mypy,doc,py
|
||||||
|
|
||||||
- name: Build deltachat-rpc-server
|
aysnc_python_tests:
|
||||||
run: cargo build -p deltachat-rpc-server
|
name: Async Python tests
|
||||||
|
needs: ["python_lint", "rpc_server"]
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# Currently used Rust version.
|
||||||
|
- os: ubuntu-latest
|
||||||
|
python: 3.11
|
||||||
|
- os: macos-latest
|
||||||
|
python: 3.11
|
||||||
|
|
||||||
|
# PyPy tests
|
||||||
|
- os: ubuntu-latest
|
||||||
|
python: pypy3.9
|
||||||
|
- os: macos-latest
|
||||||
|
python: pypy3.9
|
||||||
|
|
||||||
|
# Minimum Supported Python Version = 3.7
|
||||||
|
# This is the minimum version for which manylinux Python wheels are
|
||||||
|
# built. Test it with minimum supported Rust version.
|
||||||
|
- os: ubuntu-latest
|
||||||
|
python: 3.7
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
- name: Install tox
|
||||||
|
run: pip install tox
|
||||||
|
|
||||||
|
- name: Download deltachat-rpc-server
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }}-${{matrix.rust}}-deltachat-rpc-server
|
||||||
|
path: target/debug
|
||||||
|
|
||||||
|
- name: Make deltachat-rpc-server executable
|
||||||
|
run: chmod +x target/debug/deltachat-rpc-server
|
||||||
|
|
||||||
- name: Add deltachat-rpc-server to path
|
- name: Add deltachat-rpc-server to path
|
||||||
run: echo ${{ github.workspace }}/target/debug >> $GITHUB_PATH
|
run: echo ${{ github.workspace }}/target/debug >> $GITHUB_PATH
|
||||||
|
|||||||
Reference in New Issue
Block a user