• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: Update
30        uses: actions-rs/cargo@v1
31        with:
32          command: update
33          args: --manifest-path=Cargo.toml
34      - name: Clippy
35        uses: actions-rs/cargo@v1
36        with:
37          command: clippy
38      - name: Build
39        uses: actions-rs/cargo@v1
40        with:
41          command: build
42          args: --manifest-path=Cargo.toml
43      - name: Test
44        uses: actions-rs/cargo@v1
45        with:
46          command: test
47          args: --manifest-path=Cargo.toml -- --nocapture
48      - name: Test Release
49        uses: actions-rs/cargo@v1
50        with:
51          command: test
52          args: --manifest-path=Cargo.toml --release -- --nocapture
53      - name: Documentation
54        uses: actions-rs/cargo@v1
55        with:
56          command: doc
57          args: --manifest-path=Cargo.toml
58        env:
59          RUSTDOCFLAGS: --cfg docsrs
60        if: ${{ matrix.rust_toolchain == 'nightly' }}
61
62  windows-gnu-test:
63    runs-on: windows-latest
64    strategy:
65      fail-fast: false
66      matrix:
67        rust_toolchain: [nightly, stable]
68        rust_target:
69          - x86_64-pc-windows-gnu
70          - i686-pc-windows-gnu
71    steps:
72      - uses: actions/checkout@v2
73      - name: Add MSYS2 to the PATH
74        run: echo "c:/msys64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
75      - name: Add 32-bit mingw-w64 to the PATH
76        run: echo "c:/msys64/mingw32/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
77        if: startsWith(matrix.rust_target, 'i686')
78      - name: Add 64-bit mingw-w64 to the PATH
79        run: echo "c:/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
80        if: startsWith(matrix.rust_target, 'x86_64')
81      - name: Set TARGET variable
82        run: echo "TARGET=${{ matrix.rust_target}}" | Out-File -FilePath $env:GITHUB_ENV -Append
83      - name: Install Rust nightly
84        uses: actions-rs/toolchain@v1
85        with:
86            toolchain: ${{ matrix.rust_toolchain }}
87            target: ${{ matrix.rust_target }}
88            profile: minimal
89            default: true
90      - uses: actions-rs/cargo@v1
91        with:
92          command: build
93          args: --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml
94      - uses: actions-rs/cargo@v1
95        with:
96          command: test
97          args: --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml
98
99  bare-cross-build:
100    runs-on: ubuntu-latest
101    strategy:
102      fail-fast: false
103      matrix:
104        rust_target:
105          # BSDs: could be tested with full system emulation
106          # - x86_64-unknown-dragonfly
107          # - x86_64-unknown-freebsd
108          - x86_64-unknown-haiku
109          # - x86_64-unknown-netbsd
110          - x86_64-unknown-openbsd
111          - x86_64-unknown-redox
112          - x86_64-fuchsia
113    timeout-minutes: 20
114    steps:
115      - uses: actions/checkout@v2
116      - name: Install Rust nightly
117        uses: actions-rs/toolchain@v1
118        with:
119            toolchain: nightly
120            profile: minimal
121            default: true
122      - name: Fix-up toolchain
123        run: |
124            rustup component add rust-src --toolchain nightly --target ${{ matrix.rust_target }}
125      - name: Update
126        uses: actions-rs/cargo@v1
127        with:
128          command: update
129          args: --manifest-path=Cargo.toml
130      - name: Build ${{ matrix.rust_target }}
131        uses: actions-rs/cargo@v1
132        with:
133          command: build
134          args: --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml -Zbuild-std
135
136  cross-ios-build:
137    runs-on: macos-latest
138    strategy:
139      fail-fast: false
140      matrix:
141        rust_toolchain: [nightly, stable]
142        rust_target:
143          - aarch64-apple-ios
144          - x86_64-apple-ios
145    timeout-minutes: 20
146    steps:
147      - uses: actions/checkout@v2
148      - name: Install Rust ${{ matrix.rust_toolchain }}
149        uses: actions-rs/toolchain@v1
150        with:
151            toolchain: ${{ matrix.rust_toolchain }}
152            target: ${{ matrix.rust_target }}
153            profile: minimal
154            default: true
155      - name: Update
156        uses: actions-rs/cargo@v1
157        with:
158          command: update
159          args: --manifest-path=Cargo.toml
160      - name: Build ${{ matrix.rust_target }}
161        uses: actions-rs/cargo@v1
162        with:
163          command: build
164          args: --target=${{ matrix.rust_target }} --manifest-path=Cargo.toml
165