-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.41 KB
/
ci.yml
File metadata and controls
67 lines (55 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rust:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
test:
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Lint
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test
validate-recipes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate provider JSON files
run: |
exit_code=0
for f in providers/*.json; do
if ! python3 -m json.tool "$f" > /dev/null 2>&1; then
echo "::error file=$f::Invalid JSON in $f"
exit_code=1
fi
done
exit $exit_code
- name: Validate recipe index
run: |
bash scripts/generate-index.sh
git diff --exit-code providers/index.json