-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (102 loc) · 3.12 KB
/
on_pr.yaml
File metadata and controls
112 lines (102 loc) · 3.12 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
name: Pull Request
on:
# Enable manual running of action if necessary
workflow_dispatch:
# Build and test deployment the image on pushes to main branch
pull_request:
# # Only publish on push to main branch
# branches:
# - main
# Only run if the PR yaml, Dockerfile, sh, py or rs files have changed
paths:
- Dockerfile**
- "**on_pr.yaml"
- "**.rs"
- "**.sh"
- "**.toml"
jobs:
check:
name: Check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- name: Install Rust and deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libzmq3-dev librtlsdr-dev
- uses: actions-rs/cargo@v1.0.3
with:
command: check
fmt:
name: Rustfmt
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1.0.3
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6.0.2
- uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
components: clippy
override: true
- name: Install Rust and deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libzmq3-dev librtlsdr-dev
- uses: actions-rs/clippy-check@v1.0.7
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
name: Clippy Output
hadolint:
name: "Linting: hadolint"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6.0.2
- name: Pull hadolint/hadolint:latest Image
run: docker pull hadolint/hadolint:latest
- name: Run hadolint against Dockerfiles
run: docker run --rm -i -v "$PWD":/workdir --workdir /workdir --entrypoint hadolint hadolint/hadolint --ignore DL3013 --ignore DL3008 $(find . -type f -iname "Dockerfile*")
test_rust_functionality:
name: Build and test rust functionality
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Install Rust and deps
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
sudo apt-get update
sudo apt-get install -y --no-install-recommends libzmq3-dev librtlsdr-dev
- name: Run tests
run: |
env CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test
test_docker_image_build:
name: Test Docker Image Build
needs: [hadolint]
uses: sdr-enthusiasts/common-github-workflows/.github/workflows/sdre.yml@main
with:
docker_build_file: Dockerfile.local
ghcr_repo_owner: ${{ github.repository_owner }}
ghcr_repo: ${{ github.repository }}