Skip to content

Commit 7bfa0a6

Browse files
authored
Add workflow
2 parents 02ad30a + 5bae24a commit 7bfa0a6

File tree

5 files changed

+40
-15
lines changed

5 files changed

+40
-15
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
name: "build-test"
3+
on: [pull_request]
4+
5+
jobs:
6+
check-pr:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: checkout source
10+
uses: actions/checkout@v1
11+
12+
- name: run action
13+
uses: ./
14+
with:
15+
configDirectory: test

Dockerfile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
FROM alpine:latest
1+
FROM alpine:3.11.2
22

3-
LABEL version="0.1.0"
4-
LABEL repository="https://github.com/plexsystems/protolint-action"
5-
LABEL homepage="https://github.com/plexsystems/protolint-action"
3+
RUN apk add curl
64

7-
COPY LICENSE README.md /
8-
9-
ARG PROTOLINT_VERSION=0.17.0
10-
RUN wget https://github.com/yoheimuta/protolint/releases/download/v${PROTOLINT_VERSION}/protolint_${PROTOLINT_VERSION}_Linux_x86_64.tar.gz \
11-
&& tar xf protolint_${PROTOLINT_VERSION}_Linux_x86_64.tar.gz \
12-
&& mv protolint /usr/local/bin/protolint
13-
14-
ENTRYPOINT ["protolint"]
5+
ARG PROTOLINT_VERSION=0.23.1
6+
RUN curl -LO https://github.com/yoheimuta/protolint/releases/download/v${PROTOLINT_VERSION}/protolint_${PROTOLINT_VERSION}_Linux_x86_64.tar.gz \
7+
&& tar xf protolint_${PROTOLINT_VERSION}_Linux_x86_64.tar.gz \
8+
&& chmod +x protolint \
9+
&& mv protolint /usr/local/bin/protolint

action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ branding:
77
color: 'black'
88

99
inputs:
10-
command:
11-
description: 'The command to run with protolint'
10+
configDirectory:
11+
description: 'The path to your protolint configuration'
1212
required: true
1313

1414
runs:
1515
using: 'docker'
1616
image: 'Dockerfile'
1717
args:
18-
- ${{ inputs.command }}
18+
- protolint
19+
- lint
20+
- -config_dir_path
21+
- ${{ inputs.configDirectory }}
22+
- .

test/.protolint.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lint:
2+
rules:
3+
no_default: true
4+
5+
add:
6+
- SERVICE_NAMES_UPPER_CAMEL_CASE

test/service.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
syntax = "proto3";
2+
3+
package service;
4+
5+
service MyService { }

0 commit comments

Comments
 (0)