Skip to content

Commit 740c9b4

Browse files
committed
ci: fixed CI checks by migrating off unmaintained actions-rs and installing nasm, enough for today
1 parent d8dcd8b commit 740c9b4

1 file changed

Lines changed: 71 additions & 50 deletions

File tree

.github/workflows/code.yml

Lines changed: 71 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,30 @@ jobs:
2626
runs-on: ${{ matrix.platform }}
2727
steps:
2828
- name: Checkout Repository
29-
uses: actions/checkout@v2
29+
uses: actions/checkout@v4
30+
31+
- name: Install NASM (Linux)
32+
if: runner.os == 'Linux'
33+
run: sudo apt-get update && sudo apt-get install -y nasm
34+
35+
- name: Install NASM (macOS)
36+
if: runner.os == 'macOS'
37+
run: brew install nasm
38+
39+
- name: Install NASM (Windows)
40+
if: runner.os == 'Windows'
41+
shell: pwsh
42+
run: |
43+
choco install nasm -y
44+
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
45+
3046
- name: Install Rust Toolchain
31-
uses: actions-rs/toolchain@v1
32-
with:
33-
profile: minimal
34-
toolchain: nightly
35-
- name: Install `rust-src` Rustup Component
36-
run: rustup component add rust-src
37-
- name: Run `cargo check`
38-
uses: actions-rs/cargo@v1
47+
uses: dtolnay/rust-toolchain@nightly
3948
with:
40-
command: check
49+
components: rust-src
50+
51+
- name: Run cargo check
52+
run: cargo check
4153

4254
test:
4355
name: Test
@@ -51,80 +63,89 @@ jobs:
5163
]
5264
runs-on: ${{ matrix.platform }}
5365
steps:
66+
- name: Checkout Repository
67+
uses: actions/checkout@v4
68+
69+
- name: Install NASM (Linux)
70+
if: runner.os == 'Linux'
71+
run: sudo apt-get update && sudo apt-get install -y nasm
72+
73+
- name: Install NASM (macOS)
74+
if: runner.os == 'macOS'
75+
run: brew install nasm
76+
77+
- name: Install NASM (Windows)
78+
if: runner.os == 'Windows'
79+
shell: pwsh
80+
run: |
81+
choco install nasm -y
82+
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
83+
5484
- name: Install Rust Toolchain
55-
uses: actions-rs/toolchain@v1
85+
uses: dtolnay/rust-toolchain@nightly
5686
with:
57-
profile: minimal
58-
toolchain: nightly
87+
components: rust-src, llvm-tools-preview
88+
5989
- name: Install bootimage
6090
run: cargo install bootimage --debug
61-
- name: Checkout Repository
62-
uses: actions/checkout@v2
63-
- name: Install Rustup Components
64-
run: rustup component add rust-src llvm-tools-preview
65-
- name: Run `cargo bootimage`
66-
uses: actions-rs/cargo@v1
67-
with:
68-
command: bootimage
6991

70-
# install QEMU
7192
- name: Install QEMU (Linux)
72-
run: sudo apt update && sudo apt install qemu-system-x86
93+
run: sudo apt-get update && sudo apt-get install -y qemu-system-x86
7394
if: runner.os == 'Linux'
95+
7496
- name: Install QEMU (macOS)
7597
run: brew install qemu
7698
if: runner.os == 'macOS'
7799
env:
78100
HOMEBREW_NO_AUTO_UPDATE: 1
79101
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1
80102
HOMEBREW_NO_INSTALL_CLEANUP: 1
103+
81104
- name: Install QEMU (Windows)
82-
run: |
83-
choco install qemu --version 2021.5.5
84-
echo "$Env:Programfiles\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
85105
if: runner.os == 'Windows'
86106
shell: pwsh
87-
- name: "Print QEMU Version"
107+
run: |
108+
choco install qemu -y
109+
echo "C:\Program Files\qemu" >> $env:GITHUB_PATH
110+
111+
- name: Print QEMU Version
88112
run: qemu-system-x86_64 --version
89113

90-
- name: Run `cargo test`
91-
uses: actions-rs/cargo@v1
92-
with:
93-
command: test
114+
- name: Run cargo bootimage
115+
run: cargo bootimage
116+
117+
- name: Run cargo test
118+
run: cargo test
94119

95120
check_formatting:
96121
name: Check Formatting
97122
runs-on: ubuntu-latest
98123
steps:
99124
- name: Checkout Repository
100-
uses: actions/checkout@v2
125+
uses: actions/checkout@v4
126+
101127
- name: Install Rust Toolchain
102-
uses: actions-rs/toolchain@v1
128+
uses: dtolnay/rust-toolchain@nightly
103129
with:
104-
profile: minimal
105-
toolchain: nightly
106130
components: rustfmt
107-
override: true
108-
- name: Run `cargo fmt`
109-
uses: actions-rs/cargo@v1
110-
with:
111-
command: fmt
112-
args: --all -- --check
131+
132+
- name: Run cargo fmt
133+
run: cargo fmt --all -- --check
113134

114135
clippy:
115136
name: Clippy
116137
runs-on: ubuntu-latest
117138
steps:
118139
- name: Checkout Repository
119-
uses: actions/checkout@v2
140+
uses: actions/checkout@v4
141+
142+
- name: Install NASM
143+
run: sudo apt-get update && sudo apt-get install -y nasm
144+
120145
- name: Install Rust Toolchain
121-
uses: actions-rs/toolchain@v1
146+
uses: dtolnay/rust-toolchain@nightly
122147
with:
123-
profile: minimal
124-
toolchain: nightly
125148
components: clippy, rust-src
126-
override: true
127-
- name: Run `cargo clippy`
128-
uses: actions-rs/cargo@v1
129-
with:
130-
command: clippy
149+
150+
- name: Run cargo clippy
151+
run: cargo clippy

0 commit comments

Comments
 (0)