73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
# Copyright 2026 Schwarz Digits Cloud GmbH & Co. KG
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
name: "Default CI"
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
todo-check:
|
|
name: "Check for Open TODOs"
|
|
runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'stackit-ubuntu-22' }}
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Search codebase
|
|
run: |
|
|
# Searches recursively (-r), showing line numbers (-n), ignoring binary files (-I)
|
|
# Excludes the .git directory to prevent false positives
|
|
if grep -rnIE "# ?TODO" --exclude-dir=.git --exclude-dir=.github .; then
|
|
echo "Error: TODOs found in the codebase. Please resolve them before merging."
|
|
exit 1
|
|
fi
|
|
echo "No TODOs found. Proceeding."
|
|
|
|
pre-commit-checks:
|
|
name: "Pre-Commit Hooks"
|
|
runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'stackit-ubuntu-22' }}
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Set up Terraform
|
|
uses: hashicorp/setup-terraform@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: "1.26"
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install addlicense
|
|
# Installs the tool and adds it to the GitHub Actions PATH so pre-commit can find it
|
|
run: |
|
|
go install github.com/google/addlicense@latest
|
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
|
|
|
- name: Run pre-commit
|
|
uses: pre-commit/action@v3.0.1
|