53
53
54
54
steps :
55
55
- name : Checkout
56
- uses : actions/checkout@v2
56
+ uses : actions/checkout@v4
57
57
58
58
- name : Install toolchain
59
59
uses : actions-rs/toolchain@v1
@@ -77,80 +77,44 @@ jobs:
77
77
78
78
test-qemu :
79
79
name : Test (${{ matrix.target }})
80
- runs-on : ubuntu-20.04
81
- env : { SSHPASS: 12345 }
80
+ runs-on : ubuntu-latest
82
81
strategy :
83
82
matrix :
84
83
include :
85
84
- target : x86_64-unknown-freebsd
86
- image : https://gitlab.com/kit-ty-kate/qemu-base-images/-/raw/master/FreeBSD-13.2-RELEASE-amd64.qcow2?inline=false
87
- md5 : 33b6bc89cdc675f5cbaf92e71ae648f8
88
- args : -net nic
85
+ os : freebsd
86
+ os-version : ' 14.0'
87
+ setup : |
88
+ curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
89
+ export PATH="$HOME/.cargo/bin:$PATH"
89
90
- target : x86_64-unknown-openbsd
90
- image : https://gitlab.com/kit-ty-kate/qemu-base-images/-/raw/master/OpenBSD-7.4-amd64.qcow2?inline=false
91
- md5 : 1b7f3867c72f1dac3901b4a08257f580
92
- args : -net nic
91
+ os : openbsd
92
+ os-version : ' 7.4'
93
+ setup : |
94
+ sudo pkg_add rust
95
+ - target : x86_64-unknown-netbsd
96
+ os : netbsd
97
+ os-version : ' 9.3'
98
+ setup : |
99
+ sudo pkgin install mozilla-rootcerts
100
+ sudo mozilla-rootcerts install
101
+ curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
102
+ export PATH="$HOME/.cargo/bin:$PATH"
93
103
fail-fast : false
94
104
95
105
steps :
96
106
- name : Checkout
97
- uses : actions/checkout@v2
98
-
99
- - name : Install QEMU
100
- run : sudo apt-get update && sudo apt-get install -y qemu-system-x86
107
+ uses : actions/checkout@v4
101
108
102
- - name : Lookup image
103
- id : lookup-image
104
- uses : actions/cache@v2
109
+ - name : Run tests (cargo)
110
+ uses :
cross-platform-actions/[email protected]
105
111
with :
106
- path : ~/image.qcow2
107
- key : ${{ matrix.target }}-image
108
-
109
- - name : Download image
110
- if : steps.lookup-image.outputs.cache-hit != 'true'
111
- run : |
112
- wget -O - --progress=dot:mega "${{ matrix.image }}" \
113
- | tee ~/image.qcow2 \
114
- | md5sum -c <(echo "${{ matrix.md5 }} -")
115
-
116
- - name : Boot image
117
- run : |
118
- qemu-system-x86_64 -m 2048 -display none -snapshot -daemonize \
119
- -drive if=ide,media=disk,file=$HOME/image.qcow2 \
120
- -net user,hostfwd=tcp::1025-:22 \
121
- ${{ matrix.args }}
122
-
123
- - name : Configure SSH
124
- run : |
125
- ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
126
- cat > ~/.ssh/config <<EOF
127
- Host qemu
128
- User root
129
- HostName localhost
130
- Port 1025
131
- EOF
132
- chmod og-rw ~
133
- parallel -t --retries 20 --delay 5 ::: 'sshpass -e ssh-copy-id -o StrictHostKeyChecking=no qemu'
134
-
135
- - name : Install toolchain (rustup)
136
- if : ${{ contains(matrix.target, 'freebsd') }}
137
- run : |
138
- ssh qemu <<'EOF'
139
- pkg install -y curl
140
- curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
141
- ln -s ~/.cargo/bin ~/bin
142
- EOF
143
-
144
- - name : Install toolchain (pkg)
145
- if : ${{ contains(matrix.target, 'openbsd') }}
146
- run : ssh qemu "pkg_add rust"
147
-
148
- - name : Copy crate
149
- run : scp -r $PWD qemu:crate
150
-
151
- # TODO: Respect RUST_TEST_THREADS
152
- - name : Run tests
153
- run : ssh qemu "cd crate && cargo test"
112
+ operating_system : ${{ matrix.os }}
113
+ architecture : ${{ matrix.architecture || 'x86-64' }}
114
+ version : ${{ matrix.os-version }}
115
+ run : |
116
+ ${{ matrix.setup }}
117
+ cargo test
154
118
155
119
check :
156
120
name : Check (${{ matrix.target }})
0 commit comments