Skip to content

Commit a9ec7f1

Browse files
authored
Merge pull request #155 from steve-downey/rel1prep
Polish for Release
2 parents 538983b + 7c6c27d commit a9ec7f1

39 files changed

+858
-88
lines changed

.devcontainer/devcontainer.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// .devcontainer/devcontainer.json -*-json-*-
2+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
5+
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
6+
7+
{
8+
"name": "Beman Project Generic Devcontainer",
9+
"image": "ghcr.io/bemanproject/infra-containers-devcontainer-gcc:14",
10+
"postCreateCommand": "pre-commit",
11+
"customizations": {
12+
"vscode": {
13+
"extensions": [
14+
"ms-vscode.cpptools",
15+
"ms-vscode.cmake-tools"
16+
]
17+
}
18+
}
19+
}

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
# minute hour day month day-of-week
99
# Run at 12:25 UTC every day
1010
- cron: '25 12 * * *'
11+
permissions:
12+
contents: read
1113

1214
jobs:
1315
build:
@@ -111,6 +113,9 @@ jobs:
111113
runs-on: ubuntu-latest
112114
needs: [build]
113115
if: failure() && github.event_name == 'schedule'
116+
permissions:
117+
contents: read
118+
issues: write
114119
steps:
115120
# See https://github.com/cli/cli/issues/5075
116121
- uses: actions/checkout@v6

.github/workflows/ci_tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
name: Continuous Integration Tests
44

5+
permissions:
6+
contents: read
7+
58
on:
69
push:
710
branches:
@@ -127,4 +130,7 @@ jobs:
127130
create-issue-when-fault:
128131
needs: [preset-test, build-and-test]
129132
if: failure() && github.event_name == 'schedule'
133+
permissions:
134+
contents: read
135+
issues: write
130136
uses: bemanproject/infra-workflows/.github/workflows/[email protected]

.github/workflows/codeql.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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: Checkout repository
62+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
63+
with:
64+
persist-credentials: false
65+
66+
# Add any setup steps before running the `github/codeql-action/init` action.
67+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
68+
# or others). This is typically only required for manual builds.
69+
# Ensure the GitHub Actions hash is pinned if this setup step is uncommented.
70+
# - name: Setup runtime (example)
71+
# uses: actions/setup-example@v1
72+
73+
# Initializes the CodeQL tools for scanning.
74+
- name: Initialize CodeQL
75+
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
76+
with:
77+
languages: ${{ matrix.language }}
78+
build-mode: ${{ matrix.build-mode }}
79+
# If you wish to specify custom queries, you can do so here or in a config file.
80+
# By default, queries listed here will override any specified in a config file.
81+
# Prefix the list here with "+" to use these queries and those in the config file.
82+
83+
# 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
84+
# queries: security-extended,security-and-quality
85+
86+
# If the analyze step fails for one of the languages you are analyzing with
87+
# "We were unable to automatically build your code", modify the matrix above
88+
# to set the build mode to "manual" for that language. Then modify this step
89+
# to build your code.
90+
# ℹ️ Command-line programs to run using the OS shell.
91+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
92+
- if: matrix.build-mode == 'manual'
93+
shell: bash
94+
run: |
95+
echo 'If you are using a "manual" build mode for one or more of the' \
96+
'languages you are analyzing, replace this with the commands to build' \
97+
'your code, for example:'
98+
echo ' make bootstrap'
99+
echo ' make release'
100+
exit 1
101+
102+
- name: Perform CodeQL Analysis
103+
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
104+
with:
105+
category: "/language:${{matrix.language}}"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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: "Checkout code"
25+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
26+
with:
27+
persist-credentials: false
28+
29+
- name: "Run analysis"
30+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
31+
with:
32+
results_file: results.sarif
33+
results_format: sarif
34+
# Scorecard team runs a weekly scan of public GitHub repos,
35+
# see https://github.com/ossf/scorecard#public-data.
36+
# Setting `publish_results: true` helps us scale by leveraging your workflow to
37+
# extract the results instead of relying on our own infrastructure to run scans.
38+
# And it's free for you!
39+
publish_results: true
40+
41+
# Upload the results as artifacts (optional). Commenting out will disable
42+
# uploads of run results in SARIF format to the repository Actions tab.
43+
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
44+
- name: "Upload artifact"
45+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
46+
with:
47+
name: SARIF file
48+
path: results.sarif
49+
retention-days: 5
50+
51+
# Upload the results to GitHub's code scanning dashboard (optional).
52+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
53+
- name: "Upload to code-scanning"
54+
uses: github/codeql-action/upload-sarif@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
55+
with:
56+
sarif_file: results.sarif

.github/workflows/pre-commit-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Lint Check (pre-commit)
22

33
on:
4+
workflow_dispatch:
45
# We have to use pull_request_target here as pull_request does not grant
56
# enough permission for reviewdog
67
pull_request_target:
78
push:
89
branches:
910
- main
11+
permissions:
12+
contents: read
1013

1114
jobs:
1215
pre-commit:

.github/workflows/pre-commit-update.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99

1010
jobs:
1111
auto-update-pre-commit:
12+
permissions:
13+
contents: write
14+
pull-requests: write
1215
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
1316
secrets:
1417
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pre-commit
22

33
on:
44
workflow_dispatch:
5-
pull_request_target:
5+
pull_request:
66
push:
77

88
jobs:
@@ -11,6 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
if: ${{ github.event_name == 'push' }}
1313

14+
permissions:
15+
contents: read
16+
1417
steps:
1518
- name: Checkout repository
1619
uses: actions/checkout@v6
@@ -56,18 +59,16 @@ jobs:
5659
# we only lint on the changed file in PR.
5760
- name: Get Changed Files
5861
id: changed-files
59-
uses: tj-actions/changed-files@v47
62+
uses: step-security/changed-files@v46
6063

61-
# See:
62-
# https://github.com/tj-actions/changed-files?tab=readme-ov-file#using-local-git-directory-
6364
- uses: pre-commit/[email protected]
6465
id: run-pre-commit
6566
with:
6667
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
6768

6869
# Review dog posts the suggested change from pre-commit to the pr.
6970
- name: suggester / pre-commit
70-
uses: reviewdog/action-suggester@v1
71+
uses: reviewdog/action-suggester@aa38384ceb608d00f84b4690cacc83a5aba307ff #v1.24.0
7172
if: ${{ failure() && steps.run-pre-commit.conclusion == 'failure' }}
7273
with:
7374
tool_name: pre-commit

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ compile_commands.json
3232
/docs/html
3333
/docs/latex
3434
/docs/adoc/
35+
/build/
36+
/installtest/.build/

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
cmake_minimum_required(VERSION 3.27)
55

6-
project(beman.optional VERSION 0.0.0 LANGUAGES CXX)
6+
project(beman.optional VERSION 1.0.0 LANGUAGES CXX)
77

88
# Includes
99
include(CTest)

0 commit comments

Comments
 (0)