Skip to content

Commit 52c59b1

Browse files
Merge pull request #1 from bytesonus/feature/github-actions
Added github action support
2 parents 86852ec + c7e36d0 commit 52c59b1

File tree

7 files changed

+156
-44
lines changed

7 files changed

+156
-44
lines changed

.github/workflows/build.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
- staging
6+
- develop
7+
8+
name: Continuous integration
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [windows-latest, macos-latest, ubuntu-latest]
16+
rust:
17+
- stable
18+
- beta
19+
- nightly
20+
fail-fast: false
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Install Rust toolchain
26+
uses: actions-rs/toolchain@v1
27+
with:
28+
profile: minimal
29+
toolchain: ${{ matrix.rust }}
30+
override: true
31+
components: rustfmt, clippy
32+
33+
- name: Cargo build
34+
uses: actions-rs/cargo@v1
35+
with:
36+
command: build
37+
args: --release --all
38+
39+
release-master: # Publish release on push to master
40+
if: github.ref == 'refs/heads/master'
41+
runs-on: ubuntu-latest
42+
needs: build
43+
steps:
44+
- uses: actions/checkout@v2
45+
- run: git fetch --all --tags
46+
47+
- name: Check Release Version
48+
uses: thebongy/version-check@v1
49+
with:
50+
file: Cargo.toml
51+
tagFormat: v${version}
52+
id: version_check
53+
54+
- name: Publish Release
55+
uses: actions-rs/cargo@v1
56+
with:
57+
command: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --dry-run
58+
59+
release-staging:
60+
if: github.ref == 'refs/heads/staging'
61+
runs-on: ubuntu-latest
62+
needs: build
63+
steps:
64+
- uses: actions/checkout@v2
65+
- run: git fetch --all --tags
66+
67+
- name: Check Release Version
68+
uses: thebongy/version-check@v1
69+
with:
70+
file: Cargo.toml
71+
tagFormat: v${version}-beta
72+
id: version_check
73+
74+
- name: Publish Release
75+
uses: actions-rs/cargo@v1
76+
with:
77+
command: sed -i -e 's/${version}/${version}-beta/g' /tmp/file.txt && cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty --dry-run
78+

.github/workflows/pr.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- master
5+
- staging
6+
- develop
7+
name: Continuous integration (PR)
8+
jobs:
9+
version-check:
10+
if: github.base_ref == 'staging' || github.base_ref == 'master'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- run: git fetch --all --tags
16+
17+
- name: Check Release Version (staging)
18+
if: github.base_ref == 'staging'
19+
uses: thebongy/version-check@v1
20+
with:
21+
file: Cargo.toml
22+
tagFormat: v${version}-beta
23+
id: version_check_staging
24+
25+
- name: Check Release Version (master)
26+
if: github.base_ref == 'master'
27+
uses: thebongy/version-check@v1
28+
with:
29+
file: Cargo.toml
30+
tagFormat: v${version}
31+
id: version_check_master
32+
build:
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os: [windows-latest, macos-latest, ubuntu-latest]
37+
rust:
38+
- stable
39+
- beta
40+
- nightly
41+
fail-fast: false
42+
steps:
43+
- uses: actions/checkout@v2
44+
45+
- name: Install Rust toolchain
46+
uses: actions-rs/toolchain@v1
47+
with:
48+
profile: minimal
49+
toolchain: ${{ matrix.rust }}
50+
override: true
51+
components: rustfmt, clippy
52+
53+
- name: Cargo build
54+
uses: actions-rs/cargo@v1
55+
with:
56+
command: build
57+
args: --release --all
58+
59+
# - name: Cargo test
60+
# uses: actions-rs/cargo@v1
61+
# with:
62+
# command: test
63+
# args: --release --all
64+
65+
- name: Cargo fmt
66+
uses: actions-rs/cargo@v1
67+
with:
68+
command: fmt
69+
args: --all -- --check
70+
71+
- name: Cargo clippy
72+
uses: actions-rs/cargo@v1
73+
with:
74+
command: clippy
75+
args: -- -D warnings

src/juno_module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl JunoModule {
5656
}
5757

5858
#[cfg(target_family = "windows")]
59-
pub fn from_unix_socket(socket_path: &str) -> Self {
59+
pub fn from_unix_socket(_: &str) -> Self {
6060
panic!("Unix sockets are not supported on windows");
6161
}
6262

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ pub mod protocol;
88
#[macro_use]
99
pub mod macros;
1010

11-
pub use juno_module::json;
12-
pub use juno_module::JunoModule;
11+
pub use juno_module::{json, JunoModule};

src/macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#[macro_export(local_inner_macros)]
32
macro_rules! value {
43
// Hide distracting implementation details from the generated rustdoc.

tests/connection/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#[cfg(target_family = "unix")]
12
pub mod unix_socket_connection;

tests/sample.rs

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

0 commit comments

Comments
 (0)