summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/ios-rust-ffi.yml
blob: d22f9bd1bc1a938afb09d58940784a5fd0a406ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
name: iOS - Build and test Rust FFI (mullvad-ios and mullvad-api)
on:
  pull_request:
    paths:
      - .github/workflows/ios-rust-ffi.yml
      - clippy.toml
      - '**/*.rs'
  workflow_dispatch:

permissions: {}

jobs:
  build-ios:
    runs-on: macos-latest
    strategy:
      matrix:
        target: [aarch64-apple-ios, aarch64-apple-ios-sim]
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Checkout submodules
        run: |
          git config --global --add safe.directory '*'
          git submodule update --init --recursive ios/wireguard-apple

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

      - name: Install Rust
        run: rustup target add ${{ matrix.target }}

      - name: Build and test crates
        shell: bash
        env:
          RUSTFLAGS: --deny warnings
        # NOTE: Tests actually target macOS here. This is because we do not have an iOS runner
        #       handy.
        run: |
          source env.sh
          time cargo build --locked --verbose --lib -p mullvad-ios -p mullvad-api --target ${{ matrix.target }}
          time cargo test --locked --verbose --lib -p mullvad-ios -p mullvad-api

  clippy-check-ios:
    runs-on: macos-latest
    strategy:
      matrix:
        target: [aarch64-apple-ios, aarch64-apple-ios-sim]
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

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

      - name: Install Rust
        run: |
          rustup target add ${{ matrix.target }}
          rustup component add clippy

      - name: Clippy check
        shell: bash
        env:
          RUSTFLAGS: --deny warnings
        run: |
          source env.sh
          time cargo clippy --locked --all-targets --no-default-features -p mullvad-ios -p mullvad-api \
            --target ${{ matrix.target }}
          time cargo clippy --locked --all-targets --all-features -p mullvad-ios -p mullvad-api \
            --target ${{ matrix.target }}