mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-01-29 17:52:25 -05:00
We now support only “current”, “active” or “maintenance” versions according to https://nodejs.org/en/about/releases/, which are compatible with NAPI v6.
167 lines
3.7 KiB
YAML
167 lines
3.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
types:
|
|
- opened
|
|
- reopened
|
|
- synchronize
|
|
- ready_for_review
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
test-features:
|
|
name: linux / features-${{ matrix.name }}
|
|
if: github.event_name == 'push' || !github.event.pull_request.draft
|
|
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
name:
|
|
- no-encryption
|
|
- no-sled
|
|
- no-encryption-and-sled
|
|
- sled-cryptostore
|
|
- rustls-tls
|
|
- markdown
|
|
- socks
|
|
- sso-login
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
|
|
- name: Load cache
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Test
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: run
|
|
args: -p xtask -- ci test-features ${{ matrix.name }}
|
|
|
|
test-crypto-features:
|
|
name: linux / crypto-crate features
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' || !github.event.pull_request.draft
|
|
|
|
steps:
|
|
- name: Checkout the repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
|
|
- name: Load cache
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Clippy
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: run
|
|
args: -p xtask -- ci test-crypto
|
|
|
|
test:
|
|
name: ${{ matrix.name }}
|
|
if: github.event_name == 'push' || !github.event.pull_request.draft
|
|
|
|
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
name:
|
|
- linux / stable
|
|
- linux / beta
|
|
- macOS / stable
|
|
|
|
include:
|
|
- name: linux / stable
|
|
|
|
- name: linux / beta
|
|
rust: beta
|
|
|
|
- name: macOS / stable
|
|
os: macOS-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust || 'stable' }}
|
|
profile: minimal
|
|
override: true
|
|
|
|
- name: Load cache
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Test
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
|
|
test-nodejs:
|
|
name: linux / node.js (${{ matrix.node-version }})
|
|
if: github.event_name == 'push' || !github.event.pull_request.draft
|
|
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
node-version: [14.0, 16.0, 18.0]
|
|
include:
|
|
- node-version: 18.0
|
|
build-doc: true
|
|
|
|
steps:
|
|
- name: Checkout the repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
|
|
- name: Load cache
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install NPM dependencies
|
|
run: cd crates/matrix-sdk-crypto-nodejs && npm install
|
|
|
|
- name: Build the Node.js binding
|
|
run: cd crates/matrix-sdk-crypto-nodejs && npm run build
|
|
|
|
- name: Test the Node.js binding
|
|
run: cd crates/matrix-sdk-crypto-nodejs && npm run test
|
|
|
|
- if: ${{ matrix.build-doc }}
|
|
name: Build the documentation
|
|
run: cd crates/matrix-sdk-crypto-nodejs && npm run doc
|