Debian Codegraph @

.github/workflows/wsl2.yml

raw
1 name: WSL2
2
3 # spell-checker:ignore nextest noprofile norc
4
5 on:
6 pull_request:
7 push:
8 branches:
9 - '*'
10
11 permissions:
12 contents: read # to fetch code (actions/checkout)
13
14 # End the current execution if there is a new changeset in the PR.
15 concurrency:
16 group: ${{ github.workflow }}-${{ github.ref }}
17 cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
18
19 jobs:
20 test:
21 name: Test
22 runs-on: ${{ matrix.job.os }}
23 timeout-minutes: 45
24 strategy:
25 fail-fast: false
26 matrix:
27 job:
28 - { os: windows-latest, distribution: Ubuntu-24.04, features: feat_os_unix}
29 steps:
30 - uses: actions/[email protected]
31 with:
32 persist-credentials: false
33 - name: Install WSL2
34 uses: Vampire/[email protected]
35 with:
36 additional-packages: build-essential
37 distribution: ${{ matrix.job.distribution }}
38 use-cache: 'true'
39 wsl-version: 2
40 - name: Set up WSL2 user
41 shell: wsl-bash {0}
42 run: |
43 useradd -m -p password user
44 - name: Set up WSL2 shell command
45 uses: Vampire/[email protected]
46 with:
47 distribution: ${{ matrix.job.distribution }}
48 wsl-shell-command: bash -c "sudo -u user bash --noprofile --norc -euo pipefail '{0}'"
49 # it is required to use WSL2's linux file system, so we do a second checkout there
50 - name: Checkout source in WSL2
51 shell: wsl-bash {0}
52 run: |
53 git clone "$(pwd)" "$HOME/src"
54 - name: Install rust and nextest
55 shell: wsl-bash {0}
56 run: |
57 curl https://sh.rustup.rs -sSf --output rustup.sh
58 sh rustup.sh -y --profile=minimal
59 curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "$HOME/.cargo/bin"
60 - name: Test
61 shell: wsl-bash {0}
62 run: |
63 cd "$HOME/src"
64 # chmod tests expect umask 0022
65 umask 0022
66 . "$HOME/.cargo/env"
67 export CARGO_TERM_COLOR=always
68 export RUST_BACKTRACE=1
69 CARGO_INCREMENTAL=0
70 cargo nextest run --hide-progress-bar --profile ci --features '${{ matrix.job.features }}'