Browse Source

chore: set toolchain in toml & simplify CI config

Linwei Shang 1 year ago
parent
commit
172b19bdde

+ 3 - 24
.github/workflows/main.yml

@@ -9,12 +9,7 @@ jobs:
   check:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-          toolchain: stable
-          components: rustfmt, clippy
+      - uses: actions/checkout@v4
       - name: Check code format
         uses: actions-rs/cargo@v1
         with:
@@ -28,11 +23,7 @@ jobs:
   build:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-          toolchain: stable
+      - uses: actions/checkout@v4
       - name: Build with no features
         uses: actions-rs/cargo@v1
         with:
@@ -69,27 +60,15 @@ jobs:
           - x86_64
         include:
           - example: aarch64
-            toolchain: stable
-            target: aarch64-unknown-none
             packages: qemu-system-arm gcc-aarch64-linux-gnu
           - example: riscv
-            toolchain: nightly-2022-11-03
-            target: riscv64imac-unknown-none-elf
             packages: qemu-system-misc
           - example: x86_64
-            toolchain: nightly
-            target: x86_64-unknown-none
             packages: qemu-system-x86
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
       - name: Install QEMU
         run: sudo apt update && sudo apt install ${{ matrix.packages }} && sudo chmod 666 /dev/vhost-vsock
-      - uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-          toolchain: ${{ matrix.toolchain }}
-          target: ${{ matrix.target }}
-          components: llvm-tools-preview, rustfmt
       - name: Check code format
         working-directory: examples/${{ matrix.example }}
         run: cargo fmt --all -- --check

+ 5 - 0
examples/aarch64/rust-toolchain.toml

@@ -0,0 +1,5 @@
+[toolchain]
+channel = "nightly"
+components = ["rustfmt", "llvm-tools"]
+targets = ["aarch64-unknown-none"]
+profile = "minimal"

+ 0 - 1
examples/riscv/rust-toolchain

@@ -1 +0,0 @@
-nightly

+ 5 - 0
examples/riscv/rust-toolchain.toml

@@ -0,0 +1,5 @@
+[toolchain]
+channel = "nightly"
+components = ["rustfmt", "llvm-tools"]
+targets = ["riscv64imac-unknown-none-elf"]
+profile = "minimal"

+ 0 - 1
examples/x86_64/rust-toolchain

@@ -1 +0,0 @@
-nightly

+ 5 - 0
examples/x86_64/rust-toolchain.toml

@@ -0,0 +1,5 @@
+[toolchain]
+channel = "nightly"
+components = ["rustfmt", "llvm-tools"]
+targets = ["x86_64-unknown-none"]
+profile = "minimal"

+ 4 - 0
rust-toolchain.toml

@@ -0,0 +1,4 @@
+[toolchain]
+channel = "stable"
+components = ["rustfmt", "clippy"]
+profile = "minimal"