-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 3.03 KB
/
push.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Push
on:
push:
branches:
- master
pull_request:
jobs:
spec:
name: OpenAPI in JS
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
runs-on: ubuntu-22.04
steps:
- name: actions/checkout
uses: actions/checkout@v3
- name: openapitools/openapi-generator-cli
run: |
make -C tests spec
yamllint:
name: yamllint
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
runs-on: ubuntu-22.04
steps:
- name: actions/checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: install
run: |
pip3 install yamllint
- name: yamllint
run: |
make -C tests yamllint-diff
lint-enforce:
name: openapi-enforcer
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
runs-on: ubuntu-22.04
steps:
- name: actions/checkout
uses: actions/checkout@v3
- name: path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: install
run: |
pip3 install jinja2-cli
- name: openapi-enforcer-cli
run: |
make -C tests lint-enforce
lint-ibm:
name: ibm-openapi-validator
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
runs-on: ubuntu-22.04
steps:
- name: actions/checkout
uses: actions/checkout@v3
- name: path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: install
run: |
set -x
pip3 install jinja2-cli
- name: lint-openapi
run: |
make -C tests lint-ibm
no-confusion:
name: No confusion
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: athenianco/no-confusion-action@1.1.1
with:
include: '["**/*.yaml", "**/*.yml"]'
exclude_patterns: '{"openapi.yaml": ["Sub-tásks"], ".github/workflows/push.yml": ["Sub-tásks"]}'
bump_version:
name: Bump the version
needs: [spec, yamllint, lint-enforce, lint-ibm, no-confusion]
if: "!contains(github.event.head_commit.message, 'Bump version') && github.ref == 'refs/heads/master' && github.event_name == 'push'"
runs-on: ubuntu-22.04
steps:
- name: actions/checkout
uses: actions/checkout@v3
with:
fetch-depth: 100
persist-credentials: false
- name: current_version
run: |
set -x
echo "current_version=$(grep ' version: ' openapi.yaml | cut -d: -f2 | sed 's/ //g')" >> $GITHUB_ENV
- name: FragileTech/bump-version
uses: FragileTech/bump-version@main
with:
current_version: "${{ env.current_version }}"
files: openapi.yaml
commit_name: Groundskeeper Willie
commit_email: bot@athenian.co
login: gkwillie
token: ${{ secrets.GKWILLIE_TOKEN }}