Skip to content

Commit 4a6873b

Browse files
bors[bot]cuviper
andauthored
Merge #389
389: Switch CI to GitHub Actions r=cuviper a=cuviper Co-authored-by: Josh Stone <[email protected]>
2 parents 111734b + ae0e8e3 commit 4a6873b

9 files changed

Lines changed: 256 additions & 100 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- staging
6+
- trying
7+
8+
jobs:
9+
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
rust: [
16+
1.31.0, # 2018!
17+
1.32.0, # rand
18+
1.36.0, # alloc
19+
stable,
20+
beta,
21+
nightly
22+
]
23+
steps:
24+
- name: Rust install
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: ${{ matrix.rust }}
28+
profile: minimal
29+
override: true
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
- name: Build
33+
uses: actions-rs/cargo@v1
34+
with:
35+
command: build
36+
- name: Test
37+
run: ./ci/test_full.sh
38+
39+
# try a target that doesn't have std at all, but does have alloc
40+
no_std_stable:
41+
name: No Std (stable)
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Rust install
45+
uses: actions-rs/toolchain@v1
46+
with:
47+
toolchain: stable
48+
profile: minimal
49+
override: true
50+
target: thumbv6m-none-eabi
51+
- name: Checkout
52+
uses: actions/checkout@v1
53+
- name: Build
54+
uses: actions-rs/cargo@v1
55+
with:
56+
command: build
57+
args: --target thumbv6m-none-eabi --no-default-features --features "alloc libm serde rand"
58+
59+
# try a target that doesn't have std at all, nor alloc
60+
no_std_131:
61+
name: No Std (1.31.0)
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Rust install
65+
uses: actions-rs/toolchain@v1
66+
with:
67+
toolchain: 1.31.0
68+
profile: minimal
69+
override: true
70+
target: thumbv6m-none-eabi
71+
- name: Checkout
72+
uses: actions/checkout@v1
73+
- name: Build
74+
uses: actions-rs/cargo@v1
75+
with:
76+
command: build
77+
args: --target thumbv6m-none-eabi --no-default-features --features "libm"
78+
79+
fmt:
80+
name: Format
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Rust install
84+
uses: actions-rs/toolchain@v1
85+
with:
86+
toolchain: 1.42.0
87+
profile: minimal
88+
override: true
89+
components: rustfmt
90+
- name: Checkout
91+
uses: actions/checkout@v2
92+
- name: Check formatting
93+
uses: actions-rs/cargo@v1
94+
with:
95+
command: fmt
96+
args: --all -- --check

‎.github/workflows/master.yaml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: master
2+
on:
3+
push:
4+
branches:
5+
- master
6+
schedule:
7+
- cron: '0 0 * * 0' # 00:00 Sunday
8+
9+
jobs:
10+
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
rust: [1.31.0, stable]
17+
steps:
18+
- name: Rust install
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: ${{ matrix.rust }}
22+
profile: minimal
23+
override: true
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- name: Build
27+
uses: actions-rs/cargo@v1
28+
with:
29+
command: build
30+
- name: Test
31+
run: ./ci/test_full.sh

‎.github/workflows/pr.yaml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PR
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
rust: [1.31.0, stable]
13+
steps:
14+
- name: Rust install
15+
uses: actions-rs/toolchain@v1
16+
with:
17+
toolchain: ${{ matrix.rust }}
18+
profile: minimal
19+
override: true
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Build
23+
uses: actions-rs/cargo@v1
24+
with:
25+
command: build
26+
- name: Test
27+
run: ./ci/test_full.sh
28+
29+
fmt:
30+
name: Format
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Rust install
34+
uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: 1.42.0
37+
profile: minimal
38+
override: true
39+
components: rustfmt
40+
- name: Checkout
41+
uses: actions/checkout@v2
42+
- name: Check formatting
43+
uses: actions-rs/cargo@v1
44+
with:
45+
command: fmt
46+
args: --all -- --check

‎.travis.yml‎

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

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repository = "https://github.com/rust-num/num"
1010
name = "num"
1111
version = "0.3.0-pre"
1212
readme = "README.md"
13-
exclude = ["/ci/*", "/.travis.yml", "/bors.toml"]
13+
exclude = ["/bors.toml", "/ci/*", "/.github/*"]
1414
publish = false
1515
edition = "2018"
1616

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[![crate](https://img.shields.io/crates/v/num.svg)](https://crates.io/crates/num)
44
[![documentation](https://docs.rs/num/badge.svg)](https://docs.rs/num)
5-
![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)
6-
[![Travis status](https://travis-ci.org/rust-num/num.svg?branch=master)](https://travis-ci.org/rust-num/num)
5+
[![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
6+
[![build status](https://github.com/rust-num/num/workflows/master/badge.svg)](https://github.com/rust-num/num/actions)
77

88
A collection of numeric types and traits for Rust.
99

‎bors.toml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
status = [
2-
"continuous-integration/travis-ci/push",
2+
"Test (1.31.0)",
3+
"Test (1.32.0)",
4+
"Test (1.36.0)",
5+
"Test (stable)",
6+
"Test (beta)",
7+
"Test (nightly)",
8+
"No Std (1.31.0)",
9+
"No Std (stable)",
10+
"Format",
311
]

‎ci/rustup.sh‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#!/bin/sh
2-
# Use rustup to locally run the same suite of tests as .travis.yml.
3-
# (You should first install/update all versions listed below.)
2+
# Use rustup to locally run the same suite of tests as .github/workflows/
3+
# (You should first install/update all of the versions below.)
44

55
set -ex
66

7-
export TRAVIS_RUST_VERSION
8-
for TRAVIS_RUST_VERSION in 1.31.0 1.32.0 1.36.0 stable beta nightly; do
9-
run="rustup run $TRAVIS_RUST_VERSION"
10-
$run cargo build --verbose
11-
$run $PWD/ci/test_full.sh
7+
ci=$(dirname $0)
8+
for version in 1.31.0 1.32.0 1.36.0 stable beta nightly; do
9+
rustup run "$version" "$ci/test_full.sh"
1210
done

0 commit comments

Comments
 (0)