1name: Test libloading 2 3on: 4 push: 5 paths-ignore: 6 - '*.mkd' 7 - 'LICENSE' 8 pull_request: 9 types: [opened, reopened, synchronize] 10 11jobs: 12 native-test: 13 runs-on: ${{ matrix.os }} 14 strategy: 15 fail-fast: false 16 matrix: 17 rust_toolchain: [nightly, stable, 1.40.0] 18 os: [ubuntu-latest, windows-latest, macOS-latest] 19 timeout-minutes: 20 20 steps: 21 - uses: actions/checkout@v2 22 - name: Install Rust ${{ matrix.rust_toolchain }} 23 uses: actions-rs/toolchain@v1 24 with: 25 toolchain: ${{ matrix.rust_toolchain }} 26 profile: minimal 27 components: clippy 28 default: true 29 - name: Clippy 30 uses: actions-rs/cargo@v1 31 with: 32 command: clippy 33 - name: Test 34 uses: actions-rs/cargo@v1 35 with: 36 command: test 37 args: -- --nocapture 38 - name: Test Release 39 uses: actions-rs/cargo@v1 40 with: 41 command: test 42 args: --release -- --nocapture 43 - name: Documentation 44 uses: actions-rs/cargo@v1 45 with: 46 command: rustdoc 47 args: | 48 -Zunstable-options 49 --config 50 'build.rustdogflags=["--cfg", "libloading_docs", "-D", "rustdoc::broken_intra_doc_links"]' 51 if: ${{ matrix.rust_toolchain == 'nightly' }} 52 53 windows-gnu-test: 54 runs-on: windows-latest 55 strategy: 56 fail-fast: false 57 matrix: 58 rust_toolchain: [nightly, stable] 59 rust_target: 60 - x86_64-pc-windows-gnu 61 - i686-pc-windows-gnu 62 steps: 63 - uses: actions/checkout@v2 64 - name: Add MSYS2 to the PATH 65 run: echo "c:/msys64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append 66 - name: Add 32-bit mingw-w64 to the PATH 67 run: echo "c:/msys64/mingw32/bin" | Out-File -FilePath $env:GITHUB_PATH -Append 68 if: startsWith(matrix.rust_target, 'i686') 69 - name: Add 64-bit mingw-w64 to the PATH 70 run: echo "c:/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append 71 if: startsWith(matrix.rust_target, 'x86_64') 72 - name: Set TARGET variable 73 run: echo "TARGET=${{ matrix.rust_target}}" | Out-File -FilePath $env:GITHUB_ENV -Append 74 - name: Install Rust nightly 75 uses: actions-rs/toolchain@v1 76 with: 77 toolchain: ${{ matrix.rust_toolchain }} 78 target: ${{ matrix.rust_target }} 79 profile: minimal 80 default: true 81 - uses: actions-rs/cargo@v1 82 with: 83 command: build 84 args: --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml 85 - uses: actions-rs/cargo@v1 86 with: 87 command: test 88 args: --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml 89 90 bare-cross-build: 91 runs-on: ubuntu-latest 92 strategy: 93 fail-fast: false 94 matrix: 95 rust_target: 96 # BSDs: could be tested with full system emulation 97 # - x86_64-unknown-dragonfly 98 # - x86_64-unknown-freebsd 99 - x86_64-unknown-haiku 100 # - x86_64-unknown-netbsd 101 - x86_64-unknown-openbsd 102 - x86_64-unknown-redox 103 - x86_64-fuchsia 104 - wasm32-unknown-unknown 105 timeout-minutes: 20 106 steps: 107 - uses: actions/checkout@v2 108 - name: Install Rust nightly 109 uses: actions-rs/toolchain@v1 110 with: 111 toolchain: nightly 112 profile: minimal 113 default: true 114 - name: Fix-up toolchain 115 run: | 116 rustup component add rust-src --toolchain nightly --target ${{ matrix.rust_target }} 117 - name: Update 118 uses: actions-rs/cargo@v1 119 with: 120 command: update 121 args: --manifest-path=Cargo.toml 122 - name: Build ${{ matrix.rust_target }} 123 uses: actions-rs/cargo@v1 124 with: 125 command: build 126 args: --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml -Zbuild-std 127 128 cross-ios-build: 129 runs-on: macos-latest 130 strategy: 131 fail-fast: false 132 matrix: 133 rust_toolchain: [nightly, stable] 134 rust_target: 135 - aarch64-apple-ios 136 - x86_64-apple-ios 137 timeout-minutes: 20 138 steps: 139 - uses: actions/checkout@v2 140 - name: Install Rust ${{ matrix.rust_toolchain }} 141 uses: actions-rs/toolchain@v1 142 with: 143 toolchain: ${{ matrix.rust_toolchain }} 144 target: ${{ matrix.rust_target }} 145 profile: minimal 146 default: true 147 - name: Update 148 uses: actions-rs/cargo@v1 149 with: 150 command: update 151 args: --manifest-path=Cargo.toml 152 - name: Build ${{ matrix.rust_target }} 153 uses: actions-rs/cargo@v1 154 with: 155 command: build 156 args: --target=${{ matrix.rust_target }} --manifest-path=Cargo.toml 157