Skip to content

Commit 6b40746

Browse files
authored
Merge pull request #56 from HEnquist/develop
Develop
2 parents 0911add + 575dc54 commit 6b40746

File tree

11 files changed

+1229
-80
lines changed

11 files changed

+1229
-80
lines changed

.github/workflows/ci_test.yml

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on: [push, pull_request]
33
name: CI test and lint
44

55
jobs:
6-
check:
7-
name: Check
6+
check_lint_linux:
7+
name: Check test and lint Linux
88
runs-on: ubuntu-latest
99
container: ubuntu:19.10
1010
steps:
@@ -23,6 +23,7 @@ jobs:
2323
profile: minimal
2424
toolchain: stable
2525
override: true
26+
components: rustfmt, clippy
2627

2728
- name: Install Alsa devel
2829
run: apt-get install libasound2-dev -y
@@ -41,8 +42,27 @@ jobs:
4142
command: check
4243
args: --no-default-features
4344

44-
check_cross:
45-
name: CheckCross
45+
- name: Run cargo test
46+
uses: actions-rs/cargo@v1
47+
with:
48+
command: test
49+
50+
- name: Run cargo fmt
51+
uses: actions-rs/cargo@v1
52+
with:
53+
command: fmt
54+
args: --all -- --check
55+
56+
- name: Run cargo clippy
57+
uses: actions-rs/cargo@v1
58+
with:
59+
command: clippy
60+
args: -- -D warnings
61+
62+
63+
64+
check_arm:
65+
name: Check and test Linux arm
4666
runs-on: ubuntu-latest
4767
steps:
4868
- name: Checkout sources
@@ -74,17 +94,10 @@ jobs:
7494
args: --target armv7-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features socketserver
7595

7696

77-
test:
78-
name: Test Suite
79-
runs-on: ubuntu-latest
80-
container: ubuntu:19.10
97+
check_lint_windows:
98+
name: Check and test Windows
99+
runs-on: windows-latest
81100
steps:
82-
- name: Update package list
83-
run: apt-get update
84-
85-
- name: Install utils
86-
run: apt-get install curl wget -y
87-
88101
- name: Checkout sources
89102
uses: actions/checkout@v2
90103

@@ -95,28 +108,22 @@ jobs:
95108
toolchain: stable
96109
override: true
97110

98-
- name: Install Alsa devel
99-
run: apt-get install libasound2-dev -y
100-
101-
- name: Install PulseAudio
102-
run: apt-get install libpulse0 libpulse-dev -y
111+
- name: Run cargo check
112+
uses: actions-rs/cargo@v1
113+
with:
114+
command: check
115+
args: --no-default-features --features cpal-backend
103116

104117
- name: Run cargo test
105118
uses: actions-rs/cargo@v1
106119
with:
107120
command: test
121+
args: --no-default-features --features cpal-backend
108122

109-
lints:
110-
name: Lints
111-
runs-on: ubuntu-latest
112-
container: ubuntu:19.10
123+
check_lint_macos:
124+
name: Check and test macOS
125+
runs-on: macos-latest
113126
steps:
114-
- name: Update package list
115-
run: apt-get update
116-
117-
- name: Install utils
118-
run: apt-get install curl wget -y
119-
120127
- name: Checkout sources
121128
uses: actions/checkout@v2
122129

@@ -126,22 +133,19 @@ jobs:
126133
profile: minimal
127134
toolchain: stable
128135
override: true
129-
components: rustfmt, clippy
130-
131-
- name: Install Alsa devel
132-
run: apt-get install libasound2-dev -y
133-
134-
- name: Install PulseAudio
135-
run: apt-get install libpulse0 libpulse-dev -y
136136

137-
- name: Run cargo fmt
137+
- name: Run cargo check
138138
uses: actions-rs/cargo@v1
139139
with:
140-
command: fmt
141-
args: --all -- --check
140+
command: check
141+
args: --no-default-features --features cpal-backend
142142

143-
- name: Run cargo clippy
143+
- name: Run cargo test
144144
uses: actions-rs/cargo@v1
145145
with:
146-
command: clippy
147-
args: -- -D warnings
146+
command: test
147+
args: --no-default-features --features cpal-backend
148+
149+
150+
151+

.github/workflows/publish.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
linux:
10+
name: Linux
11+
runs-on: ubuntu-latest
12+
container: ubuntu:19.10
13+
steps:
14+
- name: Checkout sources
15+
uses: actions/checkout@v2
16+
17+
- name: Update package list
18+
run: apt-get update
19+
20+
- name: Install utils
21+
run: apt-get install curl wget -y
22+
23+
- name: Install stable toolchain
24+
uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: stable
28+
override: true
29+
30+
- name: Install Alsa devel
31+
run: apt-get install libasound2-dev -y
32+
33+
- name: Install PulseAudio
34+
run: apt-get install libpulse0 libpulse-dev -y
35+
36+
- name: Build
37+
uses: actions-rs/cargo@v1
38+
with:
39+
command: build
40+
args: --release
41+
42+
- name: Compress
43+
run: tar -zcvf camilladsp.tar.gz -C target/release camilladsp
44+
45+
- name: Upload binaries to release
46+
uses: svenstaro/upload-release-action@v1-release
47+
with:
48+
repo_token: ${{ secrets.GITHUB_TOKEN }}
49+
file: camilladsp.tar.gz
50+
asset_name: camilladsp-linux-amd64.tar.gz
51+
tag: ${{ github.ref }}
52+
53+
arm:
54+
name: Pi
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout sources
58+
uses: actions/checkout@v2
59+
60+
- name: Install stable toolchain
61+
uses: actions-rs/toolchain@v1
62+
with:
63+
profile: minimal
64+
toolchain: stable
65+
target: armv7-unknown-linux-gnueabihf
66+
override: true
67+
68+
- name: Build image
69+
run: docker build -t cross/armv7:v1 ./
70+
71+
- name: Build
72+
uses: actions-rs/cargo@v1
73+
with:
74+
command: build
75+
use-cross: true
76+
args: --release --target armv7-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features socketserver
77+
env:
78+
RUSTFLAGS: "-C target-feature=+neon"
79+
80+
- name: Compress
81+
run: tar -zcvf camilladsp.tar.gz -C target/armv7-unknown-linux-gnueabihf/release camilladsp
82+
83+
- name: Upload binaries to release
84+
uses: svenstaro/upload-release-action@v1-release
85+
with:
86+
repo_token: ${{ secrets.GITHUB_TOKEN }}
87+
file: camilladsp.tar.gz
88+
asset_name: camilladsp-linux-armv7.tar.gz
89+
tag: ${{ github.ref }}
90+
91+
windows:
92+
name: Windows
93+
runs-on: windows-latest
94+
steps:
95+
- name: Checkout sources
96+
uses: actions/checkout@v2
97+
98+
- name: Install stable toolchain
99+
uses: actions-rs/toolchain@v1
100+
with:
101+
profile: minimal
102+
toolchain: stable
103+
override: true
104+
105+
- name: Build
106+
uses: actions-rs/cargo@v1
107+
with:
108+
command: build
109+
args: --release --no-default-features --features cpal-backend --features socketserver
110+
111+
- name: Compress
112+
run: powershell Compress-Archive target/release/camilladsp.exe camilladsp.zip
113+
114+
- name: Upload binaries to release
115+
uses: svenstaro/upload-release-action@v1-release
116+
with:
117+
repo_token: ${{ secrets.GITHUB_TOKEN }}
118+
file: camilladsp.zip
119+
asset_name: camilladsp-windows-amd64.zip
120+
tag: ${{ github.ref }}
121+
122+
macos:
123+
name: macOS
124+
runs-on: macos-latest
125+
steps:
126+
- name: Checkout sources
127+
uses: actions/checkout@v2
128+
129+
- name: Install stable toolchain
130+
uses: actions-rs/toolchain@v1
131+
with:
132+
profile: minimal
133+
toolchain: stable
134+
override: true
135+
136+
- name: Build
137+
uses: actions-rs/cargo@v1
138+
with:
139+
command: build
140+
args: --release --no-default-features --features cpal-backend --features socketserver
141+
142+
- name: Compress
143+
run: tar -zcvf camilladsp.tar.gz -C target/release camilladsp
144+
145+
- name: Upload binaries to release
146+
uses: svenstaro/upload-release-action@v1-release
147+
with:
148+
repo_token: ${{ secrets.GITHUB_TOKEN }}
149+
file: camilladsp.tar.gz
150+
asset_name: camilladsp-macos-amd64.tar.gz
151+
tag: ${{ github.ref }}

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[package]
22
name = "camilladsp"
3-
version = "0.2.2"
3+
version = "0.3.1"
44
authors = ["Henrik Enquist <[email protected]>"]
55
description = "A flexible tool for processing audio"
66

77
[features]
88
default = ["alsa-backend", "pulse-backend", "socketserver"]
99
alsa-backend = ["alsa"]
1010
pulse-backend = ["libpulse-simple-binding", "libpulse-binding"]
11+
cpal-backend = ["cpal"]
1112
32bit = []
1213
socketserver = ["ws"]
1314
FFTW = ["fftw"]
@@ -20,8 +21,11 @@ path = "src/lib.rs"
2021
name = "camilladsp"
2122
path = "src/bin.rs"
2223

23-
[dependencies]
24+
25+
[target.'cfg(target_os="linux")'.dependencies]
2426
alsa = { version = "0.4", optional = true }
27+
28+
[dependencies]
2529
serde = { version = "1.0", features = ["derive"] }
2630
serde_yaml = "0.8"
2731
serde_with = "1.4.0"
@@ -38,6 +42,7 @@ ws = { version = "0.9.1", optional = true }
3842
libpulse-binding = { version = "2.0", optional = true }
3943
libpulse-simple-binding = { version = "2.0", optional = true }
4044
rubato = "0.4.3"
45+
cpal = { version = "0.11.0", optional = true }
4146

4247
[dev-dependencies]
4348
criterion = "0.3"

Cross.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
[target.armv7-unknown-linux-gnueabihf]
2-
image = "cross/armv7:v1"
2+
image = "cross/armv7:v1"
3+
4+
[target.armv7-unknown-linux-gnueabihf.env]
5+
passthrough = [
6+
"RUSTFLAGS",
7+
]

0 commit comments

Comments
 (0)