-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (76 loc) · 2.61 KB
/
ci.yml
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
name: CI
on: push
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
name: Protobuf lint
container:
image: bufbuild/buf:1.23.1
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: lint
run: buf lint
- name: format
run: buf format --exit-code
fishjam_protos_lint:
runs-on: ubuntu-latest
name: CI elixir lint
strategy:
matrix:
otp: ['27']
elixir: ['1.17']
steps:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Checkout the code
uses: actions/checkout@v3
- name: Install dependencies
working-directory: fishjam_protos
run: mix deps.get
- name: Compile without warnings
working-directory: fishjam_protos
id: compile
run: mix compile --warnings-as-errors
- name: Check formatting
working-directory: fishjam_protos
if: ${{ !cancelled() && steps.compile.outcome == 'success' }}
run: mix format --check-formatted
check-protobufs-update:
runs-on: ubuntu-latest
name: Fishjam protos update
strategy:
matrix:
otp: ['27']
elixir: ['1.17']
steps:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Checkout code
uses: actions/checkout@v3
- name: Install protobuf compiler (protoc) if needed
run: |
sudo apt update
sudo apt install -y protobuf-compiler
PATH=~/.mix/escripts:$PATH
mix deps.get
mix escript.install hex protobuf --force
working-directory: fishjam_protos
- name: Run compile_proto.sh
run: bash compile_proto.sh
working-directory: fishjam_protos
- name: Check for changes in protobuf files
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Generated protobuf files are not up to date. Please regenerate them and commit the changes."
git diff
exit 1
fi