File: wsl2.yml

package info (click to toggle)
rust-coreutils 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 485,976 kB
  • sloc: ansic: 103,608; asm: 28,570; sh: 8,672; python: 5,662; makefile: 474; cpp: 97; javascript: 72
file content (70 lines) | stat: -rw-r--r-- 2,087 bytes parent folder | download
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
name: WSL2

# spell-checker:ignore nextest noprofile norc

on:
  pull_request:
  push:
    branches:
      - '*'

permissions:
  contents: read # to fetch code (actions/checkout)

# End the current execution if there is a new changeset in the PR.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
  test:
    name: Test
    runs-on: ${{ matrix.job.os }}
    timeout-minutes: 45
    strategy:
      fail-fast: false
      matrix:
        job:
          - { os: windows-latest, distribution: Ubuntu-24.04, features: feat_os_unix}
    steps:
    - uses: actions/checkout@v6
      with:
        persist-credentials: false
    - name: Install WSL2
      uses: Vampire/setup-wsl@v6.0.0
      with:
        additional-packages: build-essential
        distribution: ${{ matrix.job.distribution }}
        use-cache: 'true'
        wsl-version: 2
    - name: Set up WSL2 user
      shell: wsl-bash {0}
      run: |
        useradd -m -p password user
    - name: Set up WSL2 shell command
      uses: Vampire/setup-wsl@v6.0.0
      with:
        distribution: ${{ matrix.job.distribution }}
        wsl-shell-command: bash -c "sudo -u user bash --noprofile --norc -euo pipefail '{0}'"
    # it is required to use WSL2's linux file system, so we do a second checkout there
    - name: Checkout source in WSL2
      shell: wsl-bash {0}
      run: |
        git clone "$(pwd)" "$HOME/src"
    - name: Install rust and nextest
      shell: wsl-bash {0}
      run: |
        curl https://sh.rustup.rs -sSf --output rustup.sh
        sh rustup.sh -y --profile=minimal
        curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "$HOME/.cargo/bin"
    - name: Test
      shell: wsl-bash {0}
      run: |
        cd "$HOME/src"
        # chmod tests expect umask 0022
        umask 0022
        . "$HOME/.cargo/env"
        export CARGO_TERM_COLOR=always
        export RUST_BACKTRACE=1
        CARGO_INCREMENTAL=0
        cargo nextest run --hide-progress-bar --profile ci --features '${{ matrix.job.features }}'