Skip to content

Commit 32b5df3

Browse files
Merge pull request #1 from qorix-group/dcalavrezo_new_template
template: initial template
2 parents a7cbd4d + a6e21db commit 32b5df3

35 files changed

+1411
-2
lines changed

.bazelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build --java_language_version=17
2+
build --tool_java_language_version=17
3+
build --java_runtime_version=remotejdk_17
4+
build --tool_java_runtime_version=remotejdk_17
5+
6+
test --test_output=errors
7+
8+
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
9+
common --registry=https://bcr.bazel.build

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.4.0

.github/CODEOWNERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Comment out as not in score yet
2+
# * @eclipse-score/infrastructure-tooling-community
3+
# .* @eclipse-score/infrastructure-tooling-community
4+
# .github/CODEOWNERS @eclipse-score/technical-lead
5+
6+
# in separate <module_name> repositories:
7+
#
8+
# /docs @eclipse-score/process-community
9+
# /docs/manual @eclipse-score/<module_name>/safety-manager
10+
# /docs/release @eclipse-score/<module_name>/quality-manager @eclipse-score/<module_name>/module-lead
11+
# /docs/safety_plan @eclipse-score/<module_name>/safety-manager @eclipse-score/<module_name>/module-lead
12+
# /docs/safety_analysis @eclipse-score/<module_name>/safety-manager
13+
# /docs/verification @eclipse-score/<module_name>/quality-manager @eclipse-score/<module_name>/safety-manager
14+
# /components @eclipse-score/<module_name>/technical-lead
15+
# /components/*/ @eclipse-score/<module_name>/automotive-score-committers

.github/ISSUE_TEMPLATE/bug_fix.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Bugfix
3+
about: 'Issue to track a bugfix'
4+
title: 'Bugfix: Your bugfix title'
5+
labels: 'codeowner_review'
6+
assignees: ''
7+
8+
---
9+
10+
> [!IMPORTANT]
11+
> Make sure to link this issue with the PR for your bugfix.
12+
13+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Improvement
3+
about: 'Issue to track a improvement'
4+
title: 'Improvement: Your improvement title'
5+
labels: 'codeowner_review'
6+
assignees: ''
7+
8+
---
9+
10+
> [!IMPORTANT]
11+
> Make sure to link this issue with the PR for your improvement.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Bugfix
2+
3+
> [!IMPORTANT]
4+
> Use this template only for bugfixes that do not influence topics covered by contribution requests or improvements.
5+
6+
> [!CAUTION]
7+
> Make sure to submit your pull-request as **Draft** until you are ready to have it reviewed by the Committers.
8+
9+
## Description
10+
11+
[A short description of the bug being fixed by the contribution.]
12+
13+
## Related ticket
14+
15+
> [!IMPORTANT]
16+
> Please replace `[ISSUE-NUMBER]` with the issue-number that tracks this bug fix. If there is no such
17+
> ticket yet, create one via [this issue template](../ISSUE_TEMPLATE/new?template=bug_fix.md).
18+
19+
closes [ISSUE-NUMBER] (bugfix ticket)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Improvement
2+
3+
> [!IMPORTANT]
4+
> Use this template only for improvement that do not influence topics covered by contribution requests or bug fixes.
5+
6+
> [!CAUTION]
7+
> Make sure to submit your pull-request as **Draft** until you are ready to have it reviewed by the Committers.
8+
9+
## Description
10+
11+
[A short description of the improvement being addressed by the contribution.]
12+
13+
## Related ticket
14+
15+
> [!IMPORTANT]
16+
> Please replace `[ISSUE-NUMBER]` with the issue-number that tracks this bug fix. If there is no such
17+
> ticket yet, create one via [this issue template](../ISSUE_TEMPLATE/new?template=improvement.md).
18+
19+
closes [ISSUE-NUMBER] (improvement ticket)
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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: Deploy Versioned Pages
15+
description: Will push the documentation to the gh-pages branch, possibly with a versioned URL. When the PR is closed, the documentation will be deleted.
16+
# Note: this has some shortcomings, like race conditions when multiple PRs are opened at the same time,
17+
# problems with overwriting existing files, not deleting deleted files, etc.
18+
# We'll address these when we transform this action into a truly reusable independent action.
19+
# But for now, let's get it working!
20+
21+
inputs:
22+
source_folder:
23+
description: "Path to the html files to deploy in current working directory"
24+
required: true
25+
versions_file:
26+
description: "Path to the versions file on gh-pages branch"
27+
default: "versions.json"
28+
create_comment:
29+
description: "Create a comment on the PR with the URL to the documentation" # in case of PR
30+
default: "true"
31+
32+
outputs:
33+
target_folder:
34+
description: "The target folder for the documentation"
35+
value: ${{ steps.calc.outputs.target_folder }}
36+
37+
runs:
38+
using: "composite"
39+
steps:
40+
- name: Determine target_folder
41+
id: calc
42+
shell: bash
43+
run: |
44+
if [[ "${{ github.event_name }}" == 'pull_request_target' || "${{ github.event_name }}" == 'pull_request' ]]; then
45+
target_folder="pr-${{ github.event.pull_request.number }}"
46+
else
47+
target_folder="${{github.ref_name}}"
48+
fi
49+
echo "target_folder=$target_folder" >> $GITHUB_OUTPUT
50+
51+
- name: Prepare the deploy folder
52+
shell: bash
53+
run: |
54+
# Prepare the deploy folder
55+
mkdir -p deploy_root
56+
mkdir -p version_root
57+
# Move the files to the deploy folder
58+
mv ${{ inputs.source_folder }}/* deploy_root/
59+
# Ensure that the folder is not treated as a Jekyll site
60+
touch deploy_root/.nojekyll
61+
62+
# Add the target folder to the versions file
63+
BASE_REPO="https://github.com/${{ github.repository }}.git"
64+
65+
echo "Fetching gh-pages from BASE_REPO: $BASE_REPO"
66+
git remote add base "$BASE_REPO" || git remote set-url base "$BASE_REPO"
67+
git fetch base gh-pages --depth 1
68+
69+
# Checkout only the versions file from gh-pages branch of the base repo
70+
git checkout base/gh-pages -- "${{ inputs.versions_file }}"
71+
72+
target="${{ steps.calc.outputs.target_folder }}"
73+
new_version="${{ steps.calc.outputs.target_folder }}"
74+
75+
76+
if jq -e --arg version "$new_version" 'map(select(.version == $version)) | length > 0' "${{ inputs.versions_file }}" > /dev/null; then
77+
echo "Version '$new_version' already exists in ${{ inputs.versions_file }}"
78+
else
79+
REPO_NAME=$(basename ${{ github.repository }})
80+
USER_NAME=$(echo ${{ github.repository }} | cut -d'/' -f1)
81+
GITHUB_PAGES_URL="https://${USER_NAME}.github.io/${REPO_NAME}"
82+
if [ "$target" = "/" ]; then
83+
new_url="${GITHUB_PAGES_URL}/"
84+
else
85+
new_url="${GITHUB_PAGES_URL}/$target/"
86+
fi
87+
88+
jq --arg version "$new_version" --arg url "$new_url" '. + [{"version": $version, "url": $url}]' "${{ inputs.versions_file }}" > tmp_versions.json
89+
mv tmp_versions.json "${{ inputs.versions_file }}"
90+
fi
91+
mv "${{ inputs.versions_file }}" version_root/
92+
ls -al .
93+
ls -al deploy_root
94+
ls -al version_root
95+
cat version_root/"${{ inputs.versions_file }}"
96+
97+
- name: Deploy Documentation
98+
uses: JamesIves/github-pages-deploy-action@v4
99+
with:
100+
folder: deploy_root
101+
target-folder: ${{ steps.calc.outputs.target_folder }}
102+
clean: true
103+
clean-exclude: .nojekyll
104+
105+
- name: Deploy version file 🚀
106+
uses: JamesIves/github-pages-deploy-action@v4
107+
with:
108+
folder: version_root
109+
clean: false
110+
111+
- name: Find Comment
112+
if: ${{ github.event_name == 'pull_request_target' }}
113+
uses: peter-evans/find-comment@v3
114+
id: fc
115+
with:
116+
issue-number: ${{ github.event.pull_request.number }}
117+
comment-author: 'github-actions[bot]'
118+
body-includes: The created documentation from the pull request
119+
120+
- name: Comment on PR with docs URL
121+
if: ${{ github.event_name == 'pull_request_target' && inputs.create_comment == 'true' && steps.fc.outputs.comment-id == '' }}
122+
uses: peter-evans/create-or-update-comment@v4
123+
with:
124+
issue-number: ${{github.event.pull_request.number}}
125+
body: |
126+
The created documentation from the pull request is available at: [docu-html](https://eclipse-score.github.io/score/${{steps.calc.outputs.target_folder}})
127+
reactions: rocket

.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: origin/main)"
22+
default: "origin/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/main:refs/remotes/origin/main && \
33+
git fetch origin +refs/pull/${{ inputs.pr-number }}/head && \
34+
if ! gitlint --commits origin/main..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/process/guidance/git/index.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: 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: 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+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/[email protected]
26+
- name: Setup Bazel
27+
uses: bazel-contrib/[email protected]
28+
- name: Run copyright checks
29+
run: |
30+
bazel run //:copyright.check

0 commit comments

Comments
 (0)