Skip to content

Commit a0e84c6

Browse files
ltekieliantonkri
authored andcommitted
init: initial content for the web page
- setup of the build - page content - formatting/compliance checks Issue-ref: resolves #1
1 parent 58e0a7a commit a0e84c6

32 files changed

+1996
-2
lines changed

.bazelrc

Whitespace-only changes.

.bazelversion

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

.github/actions/gitlint/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Gitlint Action"
2+
description: "An action to install and run Gitlint on PR commits"
3+
inputs:
4+
pr-number:
5+
description: "Pull Request number used to fetch commits"
6+
required: true
7+
base-branch:
8+
description: "Base branch to compare commits against (default: origin/main)"
9+
default: "origin/main"
10+
required: false
11+
runs:
12+
using: "docker"
13+
image: "jorisroovers/gitlint:0.19.1"
14+
entrypoint: /bin/sh
15+
args:
16+
- -c
17+
- |
18+
git config --global --add safe.directory /github/workspace && \
19+
git fetch origin +refs/heads/main:refs/remotes/origin/main && \
20+
git fetch origin +refs/pull/${{ inputs.pr-number }}/head && \
21+
gitlint --commits origin/main..HEAD

.github/workflows/copyright.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Copyright checks
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize]
5+
merge_group:
6+
types: [checks_requested]
7+
jobs:
8+
copyright-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/[email protected]
13+
- name: Setup Bazel
14+
uses: bazel-contrib/[email protected]
15+
- name: Run copyright checks
16+
run: |
17+
bazel run //:copyright.check

.github/workflows/docs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Documentation build
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize]
5+
push:
6+
branches:
7+
- main
8+
merge_group:
9+
types: [checks_requested]
10+
jobs:
11+
docs-build:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/[email protected]
18+
- name: Setup Bazel
19+
uses: bazel-contrib/[email protected]
20+
- name: Build documentation
21+
run: |
22+
bazel build //docs:github-pages && cp bazel-bin/docs/github-pages.tar .
23+
- name: Upload artifact for deployment
24+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
25+
uses: actions/[email protected]
26+
with:
27+
name: github-pages
28+
path: ${{ github.workspace }}/github-pages.tar
29+
retention-days: 1
30+
if-no-files-found: error
31+
- name: Upload artifact for pull request link
32+
if: github.event_name == 'pull_request'
33+
id: upload-artifact-pr
34+
uses: actions/[email protected]
35+
with:
36+
name: github-pages-${{ github.sha }}
37+
path: ${{ github.workspace }}/github-pages.tar
38+
retention-days: 1
39+
if-no-files-found: error
40+
- name: Comment artifact URL
41+
if: github.event_name == 'pull_request'
42+
run: |
43+
gh pr comment ${{ github.event.pull_request.number }} \
44+
--body "Documentation artifact: ${{ steps.upload-artifact-pr.outputs.artifact-url }}"
45+
env:
46+
GH_TOKEN: ${{ github.token }}
47+
docs-deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
permissions:
52+
pages: write
53+
id-token: write
54+
runs-on: ubuntu-latest
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
56+
needs: docs-build
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/[email protected]

.github/workflows/format.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Formatting checks
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize]
5+
merge_group:
6+
types: [checks_requested]
7+
jobs:
8+
formatting-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/[email protected]
13+
- name: Setup Bazel
14+
uses: bazel-contrib/[email protected]
15+
- name: Run formatting checks
16+
run: |
17+
bazel test //:format.check

.github/workflows/gitlint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Gitlint check
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
lint-commits:
7+
name: check-commit-messages
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
- name: Run Gitlint Action
15+
if: ${{ github.event_name == 'pull_request' }}
16+
uses: ./.github/actions/gitlint
17+
with:
18+
pr-number: ${{ github.event.number }}
19+
base-branch: ${{ github.event.pull_request.base.ref }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Bazel
2+
bazel-*
3+
MODULE.bazel.lock
4+
5+
# Ruff
6+
.ruff_cache

.gitlint

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Available rules:
2+
#
3+
# T1: title-max-length
4+
# T2: title-trailing-whitespace
5+
# T3: title-trailing-punctuation (disabled)
6+
# T4: title-hard-tab
7+
# T5: title-must-not-contain-word (disabled)
8+
# T6: title-leading-whitespace
9+
# T7: title-match-regex (disabled)
10+
# B1: body-max-line-length
11+
# B2: body-trailing-whitespace
12+
# B3: body-hard-tab
13+
# B4: body-first-line-empty
14+
# B5: body-min-length (disabled)
15+
# B6: body-is-missing (disabled)
16+
# B7: body-changed-file-mention (disabled)
17+
#
18+
# See http://jorisroovers.github.io/gitlint/rules/ for a full description.
19+
20+
# Ignore some default rules and enable regex style searching
21+
[general]
22+
ignore=T3,T5,B1,B5,B7
23+
regex-style-search=true
24+
25+
# Maximum length of the title
26+
[title-max-length]
27+
line-length=72
28+
29+
[title-match-regex]
30+
regex=^[a-z_-]+: .+$
31+
32+
# First line of the commit message body must be empty. (second line of the commit message)
33+
[body-first-line-empty]
34+
35+
# Body must contain a reference to an issue
36+
# 'see' will act as a form of reference from commits to issues without closing them.
37+
[body-match-regex]
38+
regex=Issue-ref: (see|close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) #(\d+)
39+
40+
#Ignores the title if it starts with Revert or Merge
41+
[ignore-by-title]
42+
regex=(^Revert |^Merge )

BUILD

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
test_suite(
15+
name = "format.check",
16+
tests = ["//tools/format:format.check"],
17+
)
18+
19+
alias(
20+
name = "format.fix",
21+
actual = "//tools/format:format.fix",
22+
)
23+
24+
alias(
25+
name = "copyright.check",
26+
actual = "//tools/cr_checker:copyright.check",
27+
)
28+
29+
alias(
30+
name = "copyright.fix",
31+
actual = "//tools/cr_checker:copyright.fix",
32+
)
33+
34+
filegroup(
35+
name = "repo_directories",
36+
srcs = [
37+
"docs",
38+
"tools",
39+
],
40+
visibility = [
41+
"//tools/cr_checker:__subpackages__",
42+
],
43+
)
44+
45+
exports_files([
46+
"MODULE.bazel",
47+
"BUILD",
48+
])

0 commit comments

Comments
 (0)