3
3
on :
4
4
push :
5
5
pull_request :
6
-
7
- env :
8
- qemu_version : 7.0.0
6
+ workflow_dispatch :
9
7
10
8
jobs :
11
9
build :
@@ -29,41 +27,32 @@ jobs:
29
27
command : clippy
30
28
31
29
test :
30
+ needs : build
32
31
runs-on : ubuntu-20.04
32
+ strategy :
33
+ matrix :
34
+ base-img : [slim]
35
+ qemu-version : [6.2.0, 7.0.0, 7.1.0]
33
36
steps :
34
37
- uses : actions/checkout@v3
35
- - uses : actions-rs/toolchain@v1
36
- with :
37
- profile : minimal
38
- toolchain : nightly
39
- components : llvm-tools-preview
40
- target : riscv64imac-unknown-none-elf
41
38
42
- - name : Cache QEMU
43
- id : cache-qemu
44
- uses : actions/cache@v3
39
+ - name : Login to GitHub Container Registry
40
+ uses : docker/login-action@v2
45
41
with :
46
- path : qemu-${{ env.qemu_version }}
47
- key : qemu-${{ env.qemu_version }}
48
-
49
- - name : Install ninja-build
50
- run : sudo apt-get update && sudo apt-get install -y ninja-build
42
+ registry : ghcr.io
43
+ username : ${{ github.repository_owner }}
44
+ password : ${{ secrets.GITHUB_TOKEN }}
51
45
52
- - name : Download and Compile QEMU
53
- if : steps.cache-qemu.outputs.cache-hit != 'true'
54
- run : |
55
- wget https://download.qemu.org/qemu-${{ env.qemu_version }}.tar.xz
56
- tar xf qemu-${{ env.qemu_version }}.tar.xz
57
- cd qemu-${{ env.qemu_version }}
58
- ./configure --target-list=riscv64-softmmu
59
- make -j
60
-
61
- - name : Install QEMU
62
- run : |
63
- cd qemu-${{ env.qemu_version }} && sudo make install
64
- qemu-system-riscv64 --version
46
+ - name : Pull image
47
+ run : docker pull ghcr.io/rustsbi/qemu:${{ matrix.base-img }}-${{ matrix.qemu-version }}-rv64
65
48
66
49
- name : Test
67
- uses : actions-rs/cargo@v1
50
+ uses : addnab/docker-run-action@v3
68
51
with :
69
- command : test
52
+ image : ghcr.io/rustsbi/qemu:${{ matrix.base-img }}-${{ matrix.qemu-version }}-rv64
53
+ options : -v ${{ github.workspace }}:/work
54
+ run : |
55
+ rustup component add llvm-tools-preview
56
+ rustup target add riscv64imac-unknown-none-elf
57
+ cd /work
58
+ cargo test
0 commit comments