Skip to content

Commit 2b46204

Browse files
add CI/CD workflows to the repository (#16)
1 parent bb57aeb commit 2b46204

5 files changed

Lines changed: 154 additions & 0 deletions

File tree

.github/actions/gitlint/action.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: "Gitlint Action"
15+
description: "An action to install and run Gitlint on PR commits"
16+
inputs:
17+
pr-number:
18+
description: "Pull Request number used to fetch commits"
19+
required: true
20+
base-branch:
21+
description: "Base branch to compare commits against (default: main)"
22+
default: "main"
23+
required: false
24+
runs:
25+
using: "docker"
26+
image: "jorisroovers/gitlint:0.19.1"
27+
entrypoint: /bin/sh
28+
args:
29+
- -c
30+
- |
31+
git config --global --add safe.directory /github/workspace && \
32+
git fetch origin +refs/heads/${{ inputs.base-branch }}:refs/remotes/origin/${{ inputs.base-branch }} && \
33+
git fetch origin +refs/pull/${{ inputs.pr-number }}/head && \
34+
if ! gitlint --commits origin/${{ inputs.base-branch }}..HEAD; then \
35+
echo -e "\nWARNING: Your commit message does not follow the required format." && \
36+
echo "Formatting rules: https://eclipse-score.github.io/score/main/contribute/general/git.html" && \
37+
echo -e "To fix your commit message, run:\n" && \
38+
echo " git commit --amend" && \
39+
echo "Then update your commit (fix gitlint warnings). Finally, force-push:" && \
40+
echo " git push --force-with-lease" && \
41+
exit 1; \
42+
fi

.github/workflows/copyright.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: Copyright checks
15+
on:
16+
pull_request:
17+
types: [opened, reopened, synchronize]
18+
merge_group:
19+
types: [checks_requested]
20+
jobs:
21+
copyright-check:
22+
uses: eclipse-score/cicd-workflows/.github/workflows/copyright.yml@main
23+
with:
24+
bazel-target: "run //:copyright.check"

.github/workflows/format.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: Formatting checks
15+
on:
16+
pull_request:
17+
types: [opened, reopened, synchronize]
18+
merge_group:
19+
types: [checks_requested]
20+
jobs:
21+
formatting-check:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4.2.2
26+
- name: Setup Bazel
27+
uses: bazel-contrib/setup-bazel@0.9.1
28+
- name: Run formatting checks
29+
run: |
30+
bazel test //src:format.check
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: License check preparation
15+
on:
16+
pull_request_target:
17+
types: [opened, reopened, synchronize]
18+
merge_group:
19+
types: [checks_requested]
20+
21+
permissions:
22+
pull-requests: write
23+
issues: write
24+
25+
26+
jobs:
27+
license-check:
28+
uses: eclipse-score/cicd-workflows/.github/workflows/license-check.yml@main
29+
with:
30+
repo-url: "${{ github.server_url }}/${{ github.repository }}"
31+
secrets:
32+
dash-api-token: ${{ secrets.ECLIPSE_GITLAB_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: Run Bazel Tests
15+
on:
16+
pull_request:
17+
types: [opened, reopened, synchronize]
18+
jobs:
19+
code:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4.2.2
24+
- name: Run test targets
25+
run: |
26+
bazel test ...

0 commit comments

Comments
 (0)