Skip to content

Commit d10aba3

Browse files
authored
Breathing (#1)
Add project infrastructure for my development workflows.
2 parents 0c85345 + 7c599e6 commit d10aba3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1287
-205
lines changed

.github/workflows/.yamllint

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
3+
extends: default
4+
5+
rules:
6+
braces:
7+
level: warning
8+
max-spaces-inside: 1
9+
brackets:
10+
level: warning
11+
max-spaces-inside: 1
12+
colons:
13+
level: warning
14+
commas:
15+
level: warning
16+
comments: disable
17+
comments-indentation: disable
18+
document-start: disable
19+
empty-lines:
20+
level: warning
21+
hyphens:
22+
level: warning
23+
indentation:
24+
level: warning
25+
indent-sequences: consistent
26+
line-length:
27+
max: 160
28+
level: warning
29+
allow-non-breakable-inline-mappings: true
30+
truthy: disable

.github/workflows/codeql.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
# For most projects, this workflow file will not need changing; you simply need
3+
# to commit it to your repository.
4+
#
5+
# You may wish to alter this file to override the set of languages analyzed,
6+
# or to provide custom queries or build logic.
7+
#
8+
# ******** NOTE ********
9+
# We have attempted to detect the languages in your repository. Please check
10+
# the `language` matrix defined below to confirm you have the correct set of
11+
# supported CodeQL languages.
12+
#
13+
name: "CodeQL Advanced"
14+
15+
on:
16+
push:
17+
branches: ["main"]
18+
pull_request:
19+
branches: ["main"]
20+
schedule:
21+
- cron: "33 19 * * 4"
22+
23+
# Declare default permissions as read-only
24+
permissions: read-all
25+
26+
jobs:
27+
analyze:
28+
name: Analyze (${{ matrix.language }})
29+
# Runner size impacts CodeQL analysis time. To learn more, please see:
30+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
31+
# - https://gh.io/supported-runners-and-hardware-resources
32+
# - https://gh.io/using-larger-runners (GitHub.com only)
33+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
34+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
35+
permissions:
36+
# required for all workflows
37+
security-events: write
38+
39+
# required to fetch internal or private CodeQL packs
40+
packages: read
41+
42+
# only required for workflows in private repositories
43+
actions: read
44+
contents: read
45+
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
include:
50+
- language: actions
51+
build-mode: none
52+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
53+
# Use `c-cpp` to analyze code written in C, C++ or both
54+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
55+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
56+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
57+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
58+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
59+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
60+
steps:
61+
- name: Harden the runner (Audit all outbound calls)
62+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
63+
with:
64+
egress-policy: audit
65+
66+
- name: Checkout repository
67+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
68+
with:
69+
persist-credentials: false
70+
71+
# Add any setup steps before running the `github/codeql-action/init` action.
72+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
73+
# or others). This is typically only required for manual builds.
74+
# Ensure the GitHub Actions hash is pinned if this setup step is uncommented.
75+
# - name: Setup runtime (example)
76+
# uses: actions/setup-example@v1
77+
78+
# Initializes the CodeQL tools for scanning.
79+
- name: Initialize CodeQL
80+
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
81+
with:
82+
languages: ${{ matrix.language }}
83+
build-mode: ${{ matrix.build-mode }}
84+
# If you wish to specify custom queries, you can do so here or in a config file.
85+
# By default, queries listed here will override any specified in a config file.
86+
# Prefix the list here with "+" to use these queries and those in the config file.
87+
88+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
89+
# queries: security-extended,security-and-quality
90+
91+
# If the analyze step fails for one of the languages you are analyzing with
92+
# "We were unable to automatically build your code", modify the matrix above
93+
# to set the build mode to "manual" for that language. Then modify this step
94+
# to build your code.
95+
# ℹ️ Command-line programs to run using the OS shell.
96+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
97+
- if: matrix.build-mode == 'manual'
98+
shell: bash
99+
run: |
100+
echo 'If you are using a "manual" build mode for one or more of the' \
101+
'languages you are analyzing, replace this with the commands to build' \
102+
'your code, for example:'
103+
echo ' make bootstrap'
104+
echo ' make release'
105+
exit 1
106+
107+
- name: Perform CodeQL Analysis
108+
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
109+
with:
110+
category: "/language:${{matrix.language}}"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Doxygen GitHub Pages Deploy Action
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- doxify
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Harden the runner (Audit all outbound calls)
19+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
20+
with:
21+
egress-policy: audit
22+
23+
- uses: DenverCoder1/doxygen-github-pages-action@a30f9538f8ef1305aeceb563018f452c7a62d200 # v2.0.0
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
branch: gh-pages
27+
folder: docs/html
28+
config_file: docs/Doxyfile
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Scorecard analysis workflow
2+
on:
3+
push:
4+
# Only the default branch is supported.
5+
branches:
6+
- main
7+
schedule:
8+
# Weekly on Saturdays.
9+
- cron: '30 1 * * 6'
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
name: Scorecard analysis
16+
runs-on: ubuntu-latest
17+
permissions:
18+
# Needed for Code scanning upload
19+
security-events: write
20+
# Needed for GitHub OIDC token if publish_results is true
21+
id-token: write
22+
23+
steps:
24+
- name: Harden the runner (Audit all outbound calls)
25+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
26+
with:
27+
egress-policy: audit
28+
29+
- name: "Checkout code"
30+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
31+
with:
32+
persist-credentials: false
33+
34+
- name: "Run analysis"
35+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
36+
with:
37+
results_file: results.sarif
38+
results_format: sarif
39+
# Scorecard team runs a weekly scan of public GitHub repos,
40+
# see https://github.com/ossf/scorecard#public-data.
41+
# Setting `publish_results: true` helps us scale by leveraging your workflow to
42+
# extract the results instead of relying on our own infrastructure to run scans.
43+
# And it's free for you!
44+
publish_results: true
45+
46+
# Upload the results as artifacts (optional). Commenting out will disable
47+
# uploads of run results in SARIF format to the repository Actions tab.
48+
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
49+
- name: "Upload artifact"
50+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
51+
with:
52+
name: SARIF file
53+
path: results.sarif
54+
retention-days: 5
55+
56+
# Upload the results to GitHub's code scanning dashboard (optional).
57+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
58+
- name: "Upload to code-scanning"
59+
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
60+
with:
61+
sarif_file: results.sarif

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@
1010

1111
# ignore vscode settings
1212
.vscode
13+
/.build/
14+
/.install/
15+
/.update-submodules
16+
/uv.lock
17+
.build

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# CMakeLists.txt -*-cmake-*-
12
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
23

34
cmake_minimum_required(VERSION 3.28...4.2)
@@ -41,6 +42,10 @@ add_subdirectory(include/beman/expected)
4142

4243
beman_install_library(beman.expected)
4344

45+
if(BEMAN_EXPECTED_BUILD_TESTS)
46+
find_package(GTest CONFIG REQUIRED)
47+
endif()
48+
4449
if(BEMAN_EXPECTED_BUILD_TESTS)
4550
enable_testing()
4651
add_subdirectory(tests/beman/expected)

0 commit comments

Comments
 (0)