Skip to content

Commit 19d9771

Browse files
committed
use GHA
1 parent 4a81fd8 commit 19d9771

File tree

6 files changed

+118
-15
lines changed

6 files changed

+118
-15
lines changed

.github/bors.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
block_labels = ["needs-decision"]
22
delete_merged_branches = true
33
required_approvals = 1
4-
status = ["continuous-integration/travis-ci/push"]
4+
status = [
5+
"ci-linux (stable)",
6+
"ci-linux (1.42.0)",
7+
"build-other (macOS-latest)",
8+
"build-other (windows-latest)",
9+
"Rustfmt"
10+
]

.github/workflows/ci.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Continuous integration
7+
8+
jobs:
9+
ci-linux:
10+
runs-on: ubuntu-20.04
11+
continue-on-error: ${{ matrix.experimental || false }}
12+
strategy:
13+
matrix:
14+
# All generated code should be running on stable now, MRSV is 1.42.0
15+
rust: [nightly, stable, 1.42.0]
16+
17+
include:
18+
# Nightly is only for reference and allowed to fail
19+
- rust: nightly
20+
experimental: true
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: ${{ matrix.rust }}
28+
override: true
29+
- name: Install all Rust targets for ${{ matrix.rust }}
30+
run: rustup target install --toolchain=${{ matrix.rust }} x86_64-unknown-linux-gnu riscv32imac-unknown-none-elf riscv64imac-unknown-none-elf riscv64gc-unknown-none-elf
31+
- name: Run CI script for x86_64-unknown-linux-gnu under ${{ matrix.rust }}
32+
run: |
33+
cargo check --target x86_64-unknown-linux-gnu --features board-hifive1
34+
cargo check --target x86_64-unknown-linux-gnu --features board-hifive1-revb
35+
cargo check --target x86_64-unknown-linux-gnu --features board-redv
36+
cargo check --target x86_64-unknown-linux-gnu --features board-lofive
37+
cargo check --target x86_64-unknown-linux-gnu --features board-lofive-r1
38+
- name: Run CI script for riscv32imac-unknown-none-elf under ${{ matrix.rust }}
39+
run: |
40+
cargo check --target riscv32imac-unknown-none-elf --features board-hifive1
41+
cargo check --target riscv32imac-unknown-none-elf --features board-hifive1-revb
42+
cargo check --target riscv32imac-unknown-none-elf --features board-redv
43+
cargo check --target riscv32imac-unknown-none-elf --features board-lofive
44+
cargo check --target riscv32imac-unknown-none-elf --features board-lofive-r1
45+
- name: Run CI script for riscv64imac-unknown-none-elf under ${{ matrix.rust }}
46+
run: |
47+
cargo check --target riscv64imac-unknown-none-elf --features board-hifive1
48+
cargo check --target riscv64imac-unknown-none-elf --features board-hifive1-revb
49+
cargo check --target riscv64imac-unknown-none-elf --features board-redv
50+
cargo check --target riscv64imac-unknown-none-elf --features board-lofive
51+
cargo check --target riscv64imac-unknown-none-elf --features board-lofive-r1
52+
- name: Run CI script for riscv64gc-unknown-none-elf under ${{ matrix.rust }}
53+
run: |
54+
cargo check --target riscv64gc-unknown-none-elf --features board-hifive1
55+
cargo check --target riscv64gc-unknown-none-elf --features board-hifive1-revb
56+
cargo check --target riscv64gc-unknown-none-elf --features board-redv
57+
cargo check --target riscv64gc-unknown-none-elf --features board-lofive
58+
cargo check --target riscv64gc-unknown-none-elf --features board-lofive-r1
59+
60+
# On macOS and Windows, we at least make sure that the crate builds and links.
61+
build-other:
62+
strategy:
63+
matrix:
64+
os:
65+
- macOS-latest
66+
- windows-latest
67+
runs-on: ${{ matrix.os }}
68+
69+
steps:
70+
- uses: actions/checkout@v2
71+
- uses: actions-rs/toolchain@v1
72+
with:
73+
profile: minimal
74+
toolchain: stable
75+
override: true
76+
- name: Build crate for host OS
77+
run: |
78+
cargo build --features board-hifive1
79+
cargo build --features board-hifive1-revb
80+
cargo build --features board-redv
81+
cargo build --features board-lofive
82+
cargo build --features board-lofive-r1

.github/workflows/rustfmt.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
on:
3+
push:
4+
branches: [ staging, trying, master ]
5+
pull_request:
6+
7+
name: Code formatting check
8+
9+
jobs:
10+
fmt:
11+
name: Rustfmt
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: stable
19+
override: true
20+
components: rustfmt
21+
- uses: actions-rs/cargo@v1
22+
with:
23+
command: fmt
24+
args: --all -- --check

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
## [Documentation](https://docs.rs/crate/hifive1)
1818

19+
## Minimum Supported Rust Version (MSRV)
20+
21+
This crate is guaranteed to compile on stable Rust 1.42.0 and up. It *might*
22+
compile with older versions but that may change in any new patch release.
23+
1924
## License
2025

2126
Copyright 2018-2019 [RISC-V team][team]

ci/install.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

ci/script.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)