Skip to content

Commit

Permalink
Merge branch 'main' into poljar/crypto-tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
poljar committed Mar 17, 2023
2 parents 42dc352 + fe69948 commit 89ddb9d
Show file tree
Hide file tree
Showing 301 changed files with 24,483 additions and 14,453 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- description of the changes in this PR -->

- [ ] Public API changes documented in changelogs (optional)

<!-- Sign-off, if not part of the commits -->
<!-- See CONTRIBUTING.md if you don't know what this is -->
Signed-off-by:
5 changes: 1 addition & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt
profile: minimal
override: true

- name: Run Benchmarks
run: cargo bench | tee benchmark-output.txt
Expand Down
153 changes: 55 additions & 98 deletions .github/workflows/bindings_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,79 +12,78 @@ on:
- synchronize
- ready_for_review

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
MATRIX_SDK_CRYPTO_NODEJS_PATH: bindings/matrix-sdk-crypto-nodejs
MATRIX_SDK_CRYPTO_JS_PATH: bindings/matrix-sdk-crypto-js

jobs:
xtask-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check xtask cache
uses: actions/cache@v3
id: xtask-cache
with:
path: target/debug/xtask
key: xtask-linux-${{ hashFiles('Cargo.toml', 'xtask/**') }}

- name: Install rust stable toolchain
if: steps.xtask-cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Build
if: steps.xtask-cache.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: build
args: -p xtask
xtask:
uses: ./.github/workflows/xtask.yml

test-uniffi-codegen:
name: Test UniFFI bindings generation
needs: xtask-linux
needs: xtask
if: github.event_name == 'push' || !github.event.pull_request.draft
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
uses: dtolnay/rust-toolchain@stable

- name: Load cache
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2

- name: Get xtask
uses: actions/cache@v3
uses: actions/cache/restore@v3
with:
path: target/debug/xtask
key: xtask-linux-${{ hashFiles('Cargo.toml', 'xtask/**') }}
key: "${{ needs.xtask.outputs.cachekey-linux }}"
fail-on-cache-miss: true

- name: Build library & generate bindings
run: target/debug/xtask ci bindings

lint-js-bindings:
strategy:
fail-fast: true
matrix:
include:
- name: "[m]-crypto-nodejs"
path: "bindings/matrix-sdk-crypto-nodejs"
- name: "[m]-crypto-js"
path: "bindings/matrix-sdk-crypto-js"

name: lint ${{ matrix.name }}
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3

- name: Install NPM dependencies
working-directory: ${{ matrix.path }}
run: npm install

- name: run lint
working-directory: ${{ matrix.path }}
run: npm run lint

test-matrix-sdk-crypto-nodejs:
name: ${{ matrix.os-name }} [m]-crypto-nodejs, v${{ matrix.node-version }}
if: github.event_name == 'push' || !github.event.pull_request.draft
Expand All @@ -111,14 +110,10 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
uses: dtolnay/rust-toolchain@stable

- name: Load cache
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -169,15 +164,12 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown
profile: minimal
override: true
targets: wasm32-unknown-unknown

- name: Load cache
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2

- name: Install Node.js
uses: actions/setup-node@v3
Expand All @@ -200,72 +192,37 @@ jobs:
working-directory: ${{ env.MATRIX_SDK_CRYPTO_JS_PATH }}
run: npm run doc

xtask-macos:
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check xtask cache
uses: actions/cache@v3
id: xtask-cache
with:
path: target/debug/xtask
key: xtask-macos-${{ hashFiles('Cargo.toml', 'xtask/**') }}

- name: Install rust stable toolchain
if: steps.xtask-cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Build
if: steps.xtask-cache.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: build
args: -p xtask

test-apple:
name: matrix-rust-components-swift
needs: xtask-macos
needs: xtask
runs-on: macos-12
if: github.event_name == 'push' || !github.event.pull_request.draft

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

# install protoc in case we end up rebuilding opentelemetry-proto
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
uses: dtolnay/rust-toolchain@nightly

- name: Install aarch64-apple-ios target
run: rustup target install aarch64-apple-ios

- name: Load cache
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2

- name: Get xtask
uses: actions/cache@v3
uses: actions/cache/restore@v3
with:
path: target/debug/xtask
key: xtask-macos-${{ hashFiles('Cargo.toml', 'xtask/**') }}
key: "${{ needs.xtask.outputs.cachekey-macos }}"
fail-on-cache-miss: true

- name: Build library & bindings
run: target/debug/xtask swift build-library
Expand All @@ -275,4 +232,4 @@ jobs:
run: swift test

- name: Build Framework
run: cargo xtask swift build-framework --only-target=aarch64-apple-ios
run: target/debug/xtask swift build-framework --only-target=aarch64-apple-ios
13 changes: 0 additions & 13 deletions .github/workflows/cancel_others.yml

This file was deleted.

Loading

0 comments on commit 89ddb9d

Please sign in to comment.