Skip to content

Commit a9ce652

Browse files
Merge pull request #175 from matthiasbeyer/actions
Replace travis with github actions
2 parents fb33478 + b3f9a09 commit a9ce652

File tree

3 files changed

+111
-23
lines changed

3 files changed

+111
-23
lines changed

.github/workflows/msrv.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
on: [push, pull_request]
2+
3+
name: MSRV
4+
5+
jobs:
6+
check:
7+
name: Check
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
rust:
12+
- stable
13+
- beta
14+
- nightly
15+
16+
steps:
17+
- name: Checkout sources
18+
uses: actions/checkout@v2
19+
20+
- name: Install toolchain
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: ${{ matrix.rust }}
24+
override: true
25+
26+
- name: Run cargo check
27+
uses: actions-rs/cargo@v1
28+
with:
29+
command: check
30+
31+
test:
32+
name: Test Suite
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
rust:
37+
- stable
38+
- beta
39+
- nightly
40+
steps:
41+
- name: Checkout sources
42+
uses: actions/checkout@v2
43+
44+
- name: Install toolchain
45+
uses: actions-rs/toolchain@v1
46+
with:
47+
toolchain: ${{ matrix.rust }}
48+
override: true
49+
50+
- name: Run cargo test
51+
uses: actions-rs/cargo@v1
52+
with:
53+
command: test
54+
55+
fmt:
56+
name: Rustfmt
57+
runs-on: ubuntu-latest
58+
strategy:
59+
matrix:
60+
rust:
61+
- stable
62+
- beta
63+
- nightly
64+
steps:
65+
- name: Checkout sources
66+
uses: actions/checkout@v2
67+
68+
- name: Install toolchain
69+
uses: actions-rs/toolchain@v1
70+
with:
71+
toolchain: ${{ matrix.rust }}
72+
override: true
73+
74+
- name: Install rustfmt
75+
run: rustup component add rustfmt
76+
77+
- name: Run cargo fmt
78+
uses: actions-rs/cargo@v1
79+
with:
80+
command: fmt
81+
args: --all -- --check
82+
83+
clippy:
84+
name: Clippy
85+
runs-on: ubuntu-latest
86+
strategy:
87+
matrix:
88+
rust:
89+
- stable
90+
- beta
91+
- nightly
92+
steps:
93+
- name: Checkout sources
94+
uses: actions/checkout@v2
95+
96+
- name: Install toolchain
97+
uses: actions-rs/toolchain@v1
98+
with:
99+
toolchain: ${{ matrix.rust }}
100+
override: true
101+
102+
- name: Install clippy
103+
run: rustup component add clippy
104+
105+
- name: Run cargo clippy
106+
uses: actions-rs/cargo@v1
107+
with:
108+
command: clippy
109+
args: -- -D warnings

.travis.yml

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

src/env.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,11 @@ impl Source for Environment {
7777
};
7878

7979
// Define a prefix pattern to test and exclude from keys
80-
let prefix_pattern = match self.prefix {
81-
Some(ref prefix) => Some(prefix.clone() + "_"),
82-
_ => None,
83-
};
80+
let prefix_pattern = self.prefix.as_ref().map(|prefix| prefix.clone() + "_");
8481

8582
for (key, value) in env::vars() {
8683
// Treat empty environment variables as unset
87-
if self.ignore_empty && value == "" {
84+
if self.ignore_empty && value.is_empty() {
8885
continue;
8986
}
9087

0 commit comments

Comments
 (0)