Skip to content

Commit 285a200

Browse files
authored
Merge pull request #17 from fermyon/simplify-ci
chore(ci): Simplify Makefile, GH Actions
2 parents e0f37e0 + 0b6fc0a commit 285a200

File tree

2 files changed

+15
-34
lines changed

2 files changed

+15
-34
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
name: Rust
1+
name: Test
22
on:
33
pull_request:
44
branches: [main]
5-
paths-ignore:
6-
- "README.md"
75
env:
86
CARGO_TERM_COLOR: always
97
jobs:
10-
build:
11-
name: Build Spin
12-
runs-on: ${{ matrix.config.os }}
13-
strategy:
14-
matrix:
15-
config:
16-
- {
17-
os: "ubuntu-latest",
18-
platformAgnosticChecks: true,
19-
}
20-
- {
21-
os: "macos-latest",
22-
}
8+
test:
9+
name: Test
10+
runs-on: ubuntu-latest
2311
steps:
2412
- uses: actions/checkout@v2
2513

@@ -33,18 +21,7 @@ jobs:
3321
- name: "Install Wasm Rust target"
3422
run: rustup target add wasm32-wasi
3523

36-
- uses: Swatinem/rust-cache@v1
37-
38-
- name: Lint
39-
if: ${{ matrix.config.platformAgnosticChecks }}
40-
run:
41-
make lint
42-
43-
- name: Cargo Build
44-
run: cargo build --release
45-
46-
- name: Cargo Test
47-
run: |
48-
make test-unit
24+
- name: Make
25+
run: make
4926
env:
50-
RUST_LOG: spin=trace
27+
RUST_LOG: spin=trace

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
.PHONY: default
2+
default: test
3+
cargo build --release
4+
15
.PHONY: test
26
test: lint test-unit
37

4-
.PHONY: lint
8+
.PHONY: lint
59
lint:
6-
cargo clippy --all-targets --all-features -- -D warnings
7-
cargo fmt --all -- --check
10+
cargo clippy --all-features -- -D warnings
11+
cargo fmt -- --check
812

913
.PHONY: test-unit
1014
test-unit:
11-
RUST_LOG=$(LOG_LEVEL) cargo test --all --no-fail-fast --target=$$(rustc -vV | sed -n 's|host: ||p') -- --nocapture --include-ignored
15+
RUST_LOG=$(LOG_LEVEL) cargo test --target=$$(rustc -vV | sed -n 's|host: ||p')

0 commit comments

Comments
 (0)