Skip to content

Commit b055c33

Browse files
committed
Consolidate GitHub Actions workflows
* Moves lint jobs into a single workflow. * Separates building from linting. * Assigns proper names to all jobs so they're usable in GitHub branch protection rules. Signed-off-by: nscuro <nscuro@protonmail.com>
1 parent 1d603bc commit b055c33

3 files changed

Lines changed: 80 additions & 43 deletions

File tree

.github/workflows/build.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This file is part of Dependency-Track.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
# Copyright (c) OWASP Foundation. All Rights Reserved.
17+
name: Build
18+
19+
on:
20+
pull_request:
21+
branches:
22+
- main
23+
24+
permissions: {}
25+
26+
jobs:
27+
build:
28+
name: Build
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
with:
33+
persist-credentials: false
34+
- name: Install imaging dependencies
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y --no-install-recommends \
38+
libcairo2-dev \
39+
libffi-dev \
40+
libfreetype6-dev \
41+
libjpeg-dev \
42+
libpng-dev \
43+
libz-dev
44+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
45+
with:
46+
enable-cache: false
47+
- name: Build
48+
run: make build
Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,19 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616
# Copyright (c) OWASP Foundation. All Rights Reserved.
17-
name: docs
17+
name: Deploy
1818

1919
on:
2020
push:
2121
branches: [main]
2222
tags: ["[0-9]+.[0-9]+.[0-9]+", "[0-9]+.[0-9]+.[0-9]+-*"]
23-
pull_request:
24-
branches: [main]
2523

2624
permissions: {}
2725

2826
jobs:
29-
lint:
30-
runs-on: ubuntu-latest
31-
if: github.event_name == 'pull_request'
32-
steps:
33-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34-
with:
35-
persist-credentials: false
36-
- name: Install imaging dependencies
37-
run: |
38-
sudo apt-get update
39-
sudo apt-get install -y --no-install-recommends \
40-
libcairo2-dev libfreetype6-dev libffi-dev \
41-
libjpeg-dev libpng-dev libz-dev
42-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
43-
with:
44-
enable-cache: false
45-
- name: Lint Markdown
46-
run: make lint-markdown
47-
- name: Lint YAML
48-
run: make lint-yaml
49-
- name: Lint prose
50-
run: make lint-prose
51-
- name: Lint Python
52-
run: make lint-python
53-
- name: Build
54-
run: make build
55-
5627
deploy:
28+
name: Deploy
5729
runs-on: ubuntu-latest
58-
if: github.event_name == 'push'
5930
permissions:
6031
contents: write
6132
env:
@@ -76,8 +47,12 @@ jobs:
7647
run: |
7748
sudo apt-get update
7849
sudo apt-get install -y --no-install-recommends \
79-
libcairo2-dev libfreetype6-dev libffi-dev \
80-
libjpeg-dev libpng-dev libz-dev
50+
libcairo2-dev \
51+
libffi-dev \
52+
libfreetype6-dev \
53+
libjpeg-dev \
54+
libpng-dev \
55+
libz-dev
8156
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
8257
with:
8358
enable-cache: false
Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,40 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616
# Copyright (c) OWASP Foundation. All Rights Reserved.
17-
name: zizmor
17+
name: Lint
1818

1919
on:
20-
push:
21-
branches: [main]
2220
pull_request:
23-
branches: ["**"]
21+
branches:
22+
- main
2423

2524
permissions: {}
2625

2726
jobs:
28-
zizmor:
27+
lint-docs:
28+
name: Lint Docs
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
with:
33+
persist-credentials: false
34+
- name: Lint Markdown
35+
run: make lint-markdown
36+
- name: Lint prose
37+
run: make lint-prose
38+
- name: Lint YAML
39+
run: make lint-yaml
40+
41+
lint-gha:
42+
name: Lint GitHub Actions
2943
runs-on: ubuntu-latest
3044
permissions:
3145
security-events: write
3246
contents: read
3347
actions: read
3448
steps:
35-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36-
with:
37-
persist-credentials: false
38-
- name: Run zizmor
39-
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
49+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
50+
with:
51+
persist-credentials: false
52+
- name: Run zizmor
53+
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6

0 commit comments

Comments
 (0)