fork/static-web-server

git clone https://git.julia.blue/fork/static-web-server

Jose QuintanaUpdate dependencies 2026-03-24 and bump up Rust to 1.88.0 (#641)0b128b9

allow-symlink
10.9 KiB353 linesraw
1name: devel
2on:
3  merge_group:
4    branches:
5      - master
6  pull_request:
7    paths:
8      - .github/workflows/devel.yml
9      - .cargo/config.toml
10      - Cargo.lock
11      - Cargo.toml
12      - src/**
13      - tests/**
14  push:
15    branches:
16    - master
17    paths:
18      - .github/workflows/devel.yml
19      - .cargo/config.toml
20      - Cargo.lock
21      - Cargo.toml
22      - src/**
23      - tests/**
24  schedule:
25    - cron: '30 01 * * *' # Every day at 01:30 UTC
26
27jobs:
28  checks:
29    name: Code checks
30    runs-on: ubuntu-22.04
31
32    steps:
33    - name: Checkout repository
34      uses: actions/checkout@v4
35      with:
36        fetch-depth: 1
37
38    - name: Install stable toolchain
39      uses: dtolnay/rust-toolchain@stable
40      with:
41        toolchain: stable
42        components: rustfmt, clippy
43
44    - name: Check formatting
45      run: |
46        cargo fmt --all -- --check tests/*.rs
47
48    - name: Check via Clippy
49      run: |
50        cargo clippy --all-features -- -D warnings
51
52    - name: Check via Clippy (tests)
53      run: |
54        cargo clippy --all-features --tests -- -D warnings
55
56  test:
57    name: Test
58    runs-on: ${{ matrix.os }}
59    env:
60      # Cargo binary
61      CARGO_BIN: cargo
62      # When CARGO_BIN is set to CROSS, this is set to `--target matrix.target`
63      TARGET_FLAGS: ""
64      # When CARGO_BIN is set to CROSS, TARGET_DIR includes matrix.target
65      TARGET_DIR: ./target
66      # Emit backtraces on panics
67      RUST_BACKTRACE: 1
68      # Skip tests
69      SKIP_TESTS: ""
70      # SWS features for Cargo build
71      CARGO_FEATURES: "--features=all"
72    strategy:
73      matrix:
74        build:
75          - pinned
76          - linux-musl
77          - linux-musl-arm64
78          - linux-musl-i686
79          - linux-gnu
80          - linux-gnu-arm64
81          - linux-gnu-i686
82          - linux-arm-gnueabihf
83          - linux-musl-armv6
84          - linux-musl-armv7
85          - linux-gnu-armv7
86          - linux-ppc64le
87          - linux-s390x
88          # NOTE: looks like not supported by `listenfd` crate
89          # - linux-android-armv7
90          - linux-android-arm64
91          - netbsd
92          - illumos
93          - macos
94          - macos-arm64
95          - windows-msvc
96          - windows-msvc-i686
97          - windows-msvc-arm64
98          - windows-pc-gnu
99        include:
100          # Specific Rust channels.
101          # We test against the latest and minimum Rust stable version.
102          - build: pinned
103            os: ubuntu-22.04
104            rust: 1.88.0
105          # Some of our release builds are generated by a nightly compiler to take
106          # advantage of the latest optimizations/compile time improvements.
107          - build: linux-musl
108            os: ubuntu-22.04
109            rust: stable
110            target: x86_64-unknown-linux-musl
111          - build: linux-musl-i686
112            os: ubuntu-22.04
113            rust: stable
114            target: i686-unknown-linux-musl
115          - build: linux-musl-arm64
116            os: ubuntu-22.04
117            rust: stable
118            target: aarch64-unknown-linux-musl
119          - build: linux-gnu
120            os: ubuntu-22.04
121            rust: stable
122            target: x86_64-unknown-linux-gnu
123          - build: linux-gnu-i686
124            os: ubuntu-22.04
125            rust: stable
126            target: i686-unknown-linux-gnu
127          - build: linux-gnu-arm64
128            os: ubuntu-22.04
129            rust: stable
130            target: aarch64-unknown-linux-gnu
131          - build: linux-arm-gnueabihf
132            os: ubuntu-22.04
133            rust: stable
134            target: arm-unknown-linux-gnueabihf
135          - build: linux-musl-armv6
136            os: ubuntu-22.04
137            rust: stable
138            target: arm-unknown-linux-musleabihf
139          - build: linux-musl-armv7
140            os: ubuntu-22.04
141            rust: stable
142            target: armv7-unknown-linux-musleabihf
143          - build: linux-gnu-armv7
144            os: ubuntu-22.04
145            rust: stable
146            target: armv7-unknown-linux-gnueabihf
147          - build: linux-ppc64le
148            os: ubuntu-22.04
149            rust: stable
150            target: powerpc64le-unknown-linux-gnu
151          - build: linux-s390x
152            os: ubuntu-22.04
153            rust: stable
154            target: s390x-unknown-linux-gnu
155          #  NOTE: looks like not supported by `listenfd` crate
156          # - build: linux-android-armv7
157          #   os: ubuntu-22.04
158          #   rust: stable
159          #   target: armv7-linux-androideabi
160          - build: linux-android-arm64
161            os: ubuntu-22.04
162            rust: stable
163            target: aarch64-linux-android
164          - build: netbsd
165            os: ubuntu-22.04
166            rust: stable
167            target: x86_64-unknown-netbsd
168          - build: illumos
169            os: ubuntu-22.04
170            rust: stable
171            target: x86_64-unknown-illumos
172          - build: macos
173            os: macos-14
174            rust: stable
175            target: x86_64-apple-darwin
176          - build: macos-arm64
177            os: macos-14
178            rust: stable
179            target: aarch64-apple-darwin
180          - build: windows-msvc
181            os: windows-2022
182            rust: stable
183            target: x86_64-pc-windows-msvc
184          - build: windows-msvc-i686
185            os: windows-2022
186            rust: stable
187            target: i686-pc-windows-msvc
188          - build: windows-msvc-arm64
189            os: windows-2022
190            rust: stable
191            target: aarch64-pc-windows-msvc
192          - build: windows-pc-gnu
193            os: windows-2022
194            rust: stable
195            target: x86_64-pc-windows-gnu
196
197    steps:
198    - name: Checkout repository
199      uses: actions/checkout@v4
200      with:
201        fetch-depth: 1
202
203    - name: Cache Rust Cargo/Toolchain
204      uses: actions/cache@v4
205      with:
206        path: |
207          ~/.cargo
208          **/target
209        key: rust-${{ matrix.build }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
210        restore-keys: |
211          rust-${{ matrix.build }}-${{ matrix.target }}-
212
213    - name: Install Linux/BSD tools
214      if: ${{ !contains(matrix.os, 'windows') }}
215      run: scripts/ci/install_tools.sh --target=${{ matrix.target }}
216
217    - name: Install Rust
218      uses: dtolnay/rust-toolchain@stable
219      with:
220        toolchain: ${{ matrix.rust }}
221        target: ${{ matrix.target }}
222
223    - name: Set up Cross
224      if: ${{ !contains(matrix.os, 'windows') && matrix.target != '' }}
225      shell: bash
226      run: |
227        # Use 'cargo.sh' script for Android targets only
228        if [[ "${{ matrix.build }}" == "linux-android-armv7" ]] || [[ "${{ matrix.build }}" == "linux-android-arm64" ]]; then
229          echo "CARGO_BIN=scripts/ci/cargo.sh" >> $GITHUB_ENV
230        else
231          target=''
232          case "${{ matrix.os }}" in
233            *macos*)
234              target=x86_64-apple-darwin
235            ;;
236            *)
237              target=x86_64-unknown-linux-musl
238            ;;
239          esac
240
241          echo "Installing cross..."
242          curl -sSL \
243            "https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-$target.tar.gz" \
244            | sudo tar zxf - -C /usr/local/bin/ cross cross-util
245          cross -V
246          echo "CARGO_BIN=/usr/local/bin/cross" >> $GITHUB_ENV
247        fi
248
249    - name: Setup Cargo
250      shell: bash
251      run: |
252        if [[ "${{ matrix.target }}" != "" ]]; then
253          echo "TARGET_FLAGS=--target=${{ matrix.target }}" >> $GITHUB_ENV
254          echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
255        fi
256        echo "cargo command is: ${{ env.CARGO_BIN }}"
257        echo "target flag is: ${{ env.TARGET_FLAGS }}"
258        echo "target dir is: ${{ env.TARGET_DIR }}"
259
260    - name: Setup Windows ARM64
261      if: ${{ contains(matrix.build, 'windows-msvc-arm64') }}
262      run: |
263        # ring crate: add Visual Studio Build Tools "VS 2022 C++ ARM64 build tools" and "clang" components
264        $env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin"
265
266    - name: Skip tests
267      shell: bash
268      if: ${{ contains(fromJSON('["macos-arm64", "linux-android-arm64", "linux-android-armv7", "netbsd", "illumos", "windows-msvc-arm64"]'), matrix.build) }}
269      run: |
270        # Can't run tests: cross-compiling
271        echo "SKIP_TESTS=--no-run" >> $GITHUB_ENV
272
273    - name: Run tests
274      shell: bash
275      run: |
276        ${{ env.CARGO_BIN }} test --verbose ${{ env.CARGO_FEATURES }} ${{ env.TARGET_FLAGS }} ${{ env.SKIP_TESTS }}
277
278    - name: Run build
279      shell: bash
280      run: |
281        ${{ env.CARGO_BIN }} build --bin static-web-server -vv ${{ env.CARGO_FEATURES }} ${{ env.TARGET_FLAGS }}
282
283    - name: Run executable
284      shell: bash
285      run: |
286        case "${{ matrix.build }}" in
287          *-arm*|*bsd*|*illumos*|*ppc64*|*s390x*)
288            echo "arm,bsd,illumos,ppc64,s390x are unable to execute on CI for now!"
289          ;;
290          *)
291            if [[ "${{ matrix.os }}" == "windows-2022" ]]; then
292              target/${{ matrix.target }}/debug/static-web-server.exe -h
293            else
294              target/${{ matrix.target }}/debug/static-web-server -h
295            fi
296          ;;
297        esac
298
299    - name: Turn off default features
300      shell: bash
301      run: |
302        echo "CARGO_FEATURES=--no-default-features" >> $GITHUB_ENV
303
304    - name: Run tests without default features
305      shell: bash
306      run: |
307        ${{ env.CARGO_BIN }} test --verbose ${{ env.CARGO_FEATURES }} ${{ env.TARGET_FLAGS }} ${{ env.SKIP_TESTS }}
308
309    - name: Run build without default features
310      shell: bash
311      run: |
312        ${{ env.CARGO_BIN }} build --bin static-web-server -vv ${{ env.CARGO_FEATURES }} ${{ env.TARGET_FLAGS }}
313
314    - name: Run executable without default features
315      shell: bash
316      run: |
317        case "${{ matrix.build }}" in
318          *-arm*|*bsd*|*illumos*|*ppc64*|*s390x*)
319            echo "arm,bsd,illumos,ppc64,s390x are unable to execute on CI for now!"
320          ;;
321          *)
322            if [[ "${{ matrix.os }}" == "windows-2022" ]]; then
323              target/${{ matrix.target }}/debug/static-web-server.exe -h
324            else
325              target/${{ matrix.target }}/debug/static-web-server -h
326            fi
327          ;;
328        esac
329
330  docs-check:
331    name: Docs check
332    runs-on: ubuntu-22.04
333
334    steps:
335    - name: Checkout repository
336      uses: actions/checkout@v4
337      with:
338        fetch-depth: 1
339
340    - name: Install nightly toolchain
341      uses: dtolnay/rust-toolchain@stable
342      with:
343        toolchain: nightly
344        components: rustfmt, clippy
345
346    - name: Rustdoc build
347      run: |
348        cargo +nightly rustdoc --lib -Zrustdoc-map --all-features \
349            --config "build.rustflags=[\"--cfg\", \"tokio_unstable\"]" \
350            -Zhost-config -Ztarget-applies-to-host \
351            --config "host.rustflags=[\"--cfg\", \"tokio_unstable\"]" \
352            --config "build.rustdocflags=[\"--cfg\", \"docsrs\", \"--cfg\", \"docsrs\", \"--cfg\", \"tokio_unstable\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" \
353            -Zunstable-options -- --document-private-items