浏览代码

Replaced old CI with one using GitHub Actions (#4)

The old CI was meant for cortex-m-semihosting, so it would not have
worked with this repository, and it also used Travis CI, whereas
the new one uses GitHub Actions.

The CI runs `cargo check` for the following targets:
- `riscv32i-unknown-none-elf`
- `riscv32imc-unknown-none-elf`
- `riscv32imac-unknown-none-elf`
- `riscv64imac-unknown-none-elf`
- `riscv64gc-unknown-none-elf`

It also checks formatting and doc.
Fawaz 2 年之前
父节点
当前提交
45ac4e862f
共有 7 个文件被更改,包括 66 次插入58 次删除
  1. 30 0
      .github/workflows/check.yml
  2. 17 0
      .github/workflows/doc.yml
  3. 18 0
      .github/workflows/fmt.yml
  4. 0 32
      .travis.yml
  5. 1 0
      CHANGELOG.md
  6. 0 12
      ci/install.sh
  7. 0 14
      ci/script.sh

+ 30 - 0
.github/workflows/check.yml

@@ -0,0 +1,30 @@
+name: check
+on: [push, pull_request]
+
+jobs:
+  check:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        # All generated code should be running on stable now, MRSV is 1.59.0
+        toolchain: [nightly, stable, 1.59.0]
+        target: [riscv32i-unknown-none-elf, riscv32imc-unknown-none-elf, riscv32imac-unknown-none-elf, riscv64imac-unknown-none-elf, riscv64gc-unknown-none-elf]
+
+        include:
+          # Nightly is only for reference and allowed to fail
+          - rust: nightly
+            experimental: true
+
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: ${{ matrix.toolchain }}
+          target: ${{ matrix.target }}
+          override: true
+      - uses: actions-rs/cargo@v1
+        with:
+          use-cross: true
+          command: check
+          args: --verbose --target ${{ matrix.target }}

+ 17 - 0
.github/workflows/doc.yml

@@ -0,0 +1,17 @@
+name: doc
+on: [push, pull_request]
+
+
+jobs:
+  doc:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: stable
+          override: true
+      - uses: actions-rs/cargo@v1
+        with:
+          command: doc

+ 18 - 0
.github/workflows/fmt.yml

@@ -0,0 +1,18 @@
+name: fmt
+on: [push, pull_request]
+
+jobs:
+  fmt:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: stable
+          override: true
+          components: rustfmt
+      - uses: actions-rs/cargo@v1
+        with:
+          command: fmt
+          args: --all -- --check

+ 0 - 32
.travis.yml

@@ -1,32 +0,0 @@
-language: rust
-
-matrix:
-  include:
-    - env: TARGET=thumbv7m-none-eabi
-      rust: nightly
-    - env: TARGET=x86_64-unknown-linux-gnu
-      rust: nightly
-
-before_install: set -e
-
-install:
-  - bash ci/install.sh
-
-script:
-  - bash ci/script.sh
-
-after_script: set +e
-
-cache: cargo
-before_cache:
-  # Travis can't cache files that are not readable by "others"
-  - chmod -R a+r $HOME/.cargo
-
-branches:
-  only:
-    - auto
-    - try
-
-notifications:
-  email:
-    on_success: never

+ 1 - 0
CHANGELOG.md

@@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
       bumped to 1.59.0
 - Clean up documentation, removing unnecessary references to
   cortex-m-semihosting and improving clarity.
+- Added GitHub Actions CI
 
 ## [v0.0.1] - 2018-02-27
 

+ 0 - 12
ci/install.sh

@@ -1,12 +0,0 @@
-set -euxo pipefail
-
-main() {
-    if [ $TARGET = thumbv7m-none-eabi ]; then
-        cargo install --list | grep xargo || \
-            cargo install xargo
-        rustup component list | grep 'rust-src.*installed' || \
-            rustup component add rust-src
-    fi
-}
-
-main

+ 0 - 14
ci/script.sh

@@ -1,14 +0,0 @@
-set -euxo pipefail
-
-main() {
-    local cargo=
-    if [ $TARGET = thumbv7m-none-eabi ]; then
-        cargo=xargo
-    else
-        cargo=cargo
-    fi
-
-    $cargo check --target $TARGET
-}
-
-main