aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/libloading.yml
blob: 5837da406f074421357bbd4461d21eb53bb66c44 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

on:
  push:
    branches: [master]
    paths-ignore: ['*.mkd', 'LICENSE']
  pull_request:
    types: [opened, reopened, synchronize]

jobs:
  native-test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        rust_toolchain: [nightly, stable, 1.40.0]
        os: [ubuntu-latest, windows-latest, macOS-latest]
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v2
      - run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
      - run: rustup default ${{ matrix.rust_toolchain }}
      - run: rustup component add clippy
      - run: cargo clippy
      - run: cargo test -- --nocapture
      - run: cargo test --release -- --nocapture
      - run: cargo rustdoc -Zunstable-options --config 'build.rustdocflags=["--cfg", "libloading_docs", "-D", "rustdoc::broken_intra_doc_links"]'
        if: ${{ matrix.rust_toolchain == 'nightly' }}
        # pwsh.exe drops quotes kekw. https://stackoverflow.com/a/59036879
        shell: bash

  windows-test:
    runs-on: windows-latest
    strategy:
      fail-fast: false
      matrix:
        rust_toolchain: [nightly, stable]
        rust_target:
          - x86_64-pc-windows-gnu
          - i686-pc-windows-gnu
        include:
          - rust_target: x86_64-pc-windows-gnu
            mingw_path: C:/msys64/mingw64/bin
            package: mingw-w64-x86_64-gcc
          - rust_target: i686-pc-windows-gnu
            mingw_path: C:/msys64/mingw32/bin
            package: mingw-w64-i686-gcc
    steps:
      - uses: actions/checkout@v2
      - run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
      - run: rustup default ${{ matrix.rust_toolchain }}
      - run: rustup target add ${{ matrix.rust_target }}
      - uses: msys2/setup-msys2@v2
        with:
          release: false
          install: ${{ matrix.package }}
      - run: echo "c:/msys64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
      - run: echo "${{ matrix.mingw_path }}" | Out-File -FilePath $env:GITHUB_PATH -Append
        if: ${{ matrix.mingw_path }}"
      - run: cargo test --target ${{ matrix.rust_target }}
        env:
          TARGET: ${{ matrix.rust_target}}

  bare-cross-build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust_toolchain: [nightly]
        rust_target:
          # BSDs: could be tested with full system emulation
          # - x86_64-unknown-dragonfly
          # - x86_64-unknown-freebsd
          - x86_64-unknown-haiku
          # - x86_64-unknown-netbsd
          - x86_64-unknown-openbsd
          - x86_64-unknown-redox
          - x86_64-fuchsia
          - wasm32-unknown-unknown
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v2
      - run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
      - run: rustup default ${{ matrix.rust_toolchain }}
      - run: rustup component add rust-src --toolchain nightly --target ${{ matrix.rust_target }}
      - run: cargo build --target ${{ matrix.rust_target }} -Zbuild-std

  cross-ios-build:
    runs-on: macos-latest
    strategy:
      fail-fast: false
      matrix:
        rust_toolchain: [nightly, stable]
        rust_target:
          - aarch64-apple-ios
          - x86_64-apple-ios
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v2
      - run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
      - run: rustup default ${{ matrix.rust_toolchain }}
      - run: rustup target add ${{ matrix.rust_target }}
      - run: cargo build  --target=${{ matrix.rust_target }}