Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/.beman_submodule
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[beman_submodule]
remote=https://github.com/bemanproject/infra-workflows.git
commit_hash=132186fc8bca457512d7fa0400be34ea958542a0
commit_hash=962bc39d246b4dd3e1fc34250a66d188610c30e7
allow_untracked_files=True
3 changes: 1 addition & 2 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
{"preset": "llvm-release", "image": "ghcr.io/bemanproject/infra-containers-clang:latest"},
{"preset": "appleclang-debug", "runner": "macos-latest"},
{"preset": "appleclang-release", "runner": "macos-latest"},
{"preset": "msvc-debug", "runner": "windows-latest"},
{"preset": "msvc-release", "runner": "windows-latest"}
]

Expand Down Expand Up @@ -113,7 +112,7 @@ jobs:
{ "cxxversions": ["c++23"],
"tests": [
{ "stdlibs": ["stl"],
"tests": ["Debug.Default", "Release.Default", "Release.MaxSan"]
"tests": ["Debug.Default", "Release.Default"]
}
]
},
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-beman-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ jobs:
exclude = $GITHUB_WORKSPACE/tests/.*
coveralls = $GITHUB_WORKSPACE/coverage.json
coveralls-pretty = yes
merge-mode-functions = separate
EOF
git config --global --add safe.directory $GITHUB_WORKSPACE
gcovr --verbose --config gcovr.cfg .
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/reusable-beman-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ jobs:
with:
python-version: 3.13

# We wish to run pre-commit on all files instead of the changes
# only made in the push commit.
#
# So linting error persists when there's formatting problem.
- uses: pre-commit/action@v3.0.1

pre-commit-pr:
Expand Down Expand Up @@ -51,17 +47,7 @@ jobs:
with:
python-version: 3.13

# we only lint on the changed file in PR.
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v45

# See:
# https://github.com/tj-actions/changed-files?tab=readme-ov-file#using-local-git-directory-
- uses: pre-commit/action@v3.0.1
id: run-pre-commit
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}

# Review dog posts the suggested change from pre-commit to the pr.
- name: suggester / pre-commit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-beman-submodule-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
uses: actions/checkout@v4
- name: beman submodule consistency check
run: |
(set -o pipefail; ${{ inputs.infra_path }}/tools/beman-submodule/beman-submodule status | grep -qvF '+')
(set -eo pipefail; while read line ; do echo $line | grep -qvF '+' ; done < <(${{ inputs.infra_path }}/tools/beman-submodule/beman-submodule status))
29 changes: 29 additions & 0 deletions .github/workflows/reusable-beman-update-pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: Pre-commit auto-update

on:
workflow_call:

jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit autoupdate
run: pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate
title: Auto-update pre-commit hooks
commit-message: Auto-update pre-commit hooks
body: Update versions of tools in pre-commit configs to latest version
labels: dependencies
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ repos:
hooks:
- id: gersemi
name: CMake linting
exclude: ^.*/tests/.*/data/ # Exclude test data directories
40 changes: 0 additions & 40 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,6 @@
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/appleclang-toolchain.cmake"
}
},
{
"name": "msvc-debug",
"displayName": "MSVC Debug Build",
"inherits": [
"_root-config",
"_debug-base"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/msvc-toolchain.cmake"
}
},
{
"name": "msvc-release",
"displayName": "MSVC Release Build",
Expand Down Expand Up @@ -164,13 +153,6 @@
"_root-build"
]
},
{
"name": "msvc-debug",
"configurePreset": "msvc-debug",
"inherits": [
"_root-build"
]
},
{
"name": "msvc-release",
"configurePreset": "msvc-release",
Expand Down Expand Up @@ -221,11 +203,6 @@
"inherits": "_test_base",
"configurePreset": "appleclang-release"
},
{
"name": "msvc-debug",
"inherits": "_test_base",
"configurePreset": "msvc-debug"
},
{
"name": "msvc-release",
"inherits": "_test_base",
Expand Down Expand Up @@ -335,23 +312,6 @@
}
]
},
{
"name": "msvc-debug",
"steps": [
{
"type": "configure",
"name": "msvc-debug"
},
{
"type": "build",
"name": "msvc-debug"
},
{
"type": "test",
"name": "msvc-debug"
}
]
},
{
"name": "msvc-release",
"steps": [
Expand Down
2 changes: 1 addition & 1 deletion infra/.beman_submodule
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[beman_submodule]
remote=https://github.com/bemanproject/infra.git
commit_hash=78de7eb4ff54bd12c9abb790107edc86bcda07d8
commit_hash=d7c51d169860c5ceeb8a026859bd24820ab6826d
2 changes: 1 addition & 1 deletion infra/.github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @ednolan @neatudarius @rishyak @wusatosi
* @ednolan @neatudarius @rishyak @wusatosi @JeffGarland
79 changes: 77 additions & 2 deletions infra/.github/workflows/beman-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
branches:
- main
pull_request:
workflow_call:
workflow_dispatch:
schedule:
- cron: '0 6 * * *' # 09:00AM EEST (@neatudarius' timezone)

jobs:
tests:
run_linter:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -28,9 +31,81 @@ jobs:

- name: Run linter
run: |
echo "Running linter"
uv run ruff check --diff

run_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: tools/beman-tidy
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Sync environment
run: |
uv sync

- name: Run tests
run: |
uv run pytest tests/ -v

build_and_install:
runs-on: ubuntu-latest
defaults:
run:
working-directory: tools/beman-tidy
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Sync environment
run: |
uv sync

- name: Build and install beman-tidy
run: |
uv clean
uv build
python3 -m pip install dist/beman_tidy-0.1.0-py3-none-any.whl --force-reinstall
beman-tidy --help

run_on_exemplar:
runs-on: ubuntu-latest
defaults:
run:
working-directory: tools/beman-tidy
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Sync environment
run: |
uv sync

- name: Build and install beman-tidy
run: |
uv clean
uv build
python3 -m pip install dist/beman_tidy-0.1.0-py3-none-any.whl --force-reinstall
beman-tidy --help

- name: Run installed beman-tidy on exemplar repo
run: |
git clone https://github.com/bemanproject/exemplar.git
cd exemplar/ # Testing that beman-tidy can be run from any path, e.g. from the exemplar repo.
beman-tidy --verbose --require-all .

create-issue-when-fault:
needs: [run_linter, run_tests, build_and_install, run_on_exemplar]
if: failure() && (github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
uses: ./.github/workflows/reusable-beman-create-issue-when-fault.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: 'Beman issue creation workflow'
on:
workflow_call:
workflow_dispatch:
jobs:
create-issue:
runs-on: ubuntu-latest
steps:
# See https://github.com/cli/cli/issues/5075
- uses: actions/checkout@v4
- name: Create issue
run: |
issue_num=$(gh issue list -s open -S "[SCHEDULED-BUILD] infra repo CI job failure" -L 1 --json number | jq 'if length == 0 then -1 else .[0].number end')
body="**CI job failure Report**
- **Time of Failure**: $(date -u '+%B %d, %Y, %H:%M %Z')
- **Commit**: [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
- **Action Run**: [View logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
The scheduled job triggered by cron has failed.
Please investigate the logs and recent changes associated with this commit or rerun the workflow if you believe this is an error."
if [[ $issue_num -eq -1 ]]; then
gh issue create --repo ${{ github.repository }} --title "[SCHEDULED-BUILD] infra repo CI job failure" --body "$body" --assignee ${{ github.actor }}
else
gh issue comment --repo ${{ github.repository }} $issue_num --body "$body"
fi
env:
GH_TOKEN: ${{ github.token }}
1 change: 1 addition & 0 deletions infra/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ repos:
hooks:
- id: gersemi
name: CMake linting
exclude: ^.*/tests/.*/data/ # Exclude test data directories

# Python linting and formatting
# config file: ruff.toml (not currently present but add if needed)
Expand Down
13 changes: 1 addition & 12 deletions infra/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -216,15 +217,3 @@ conflicts with the conditions of the GPLv2, you may retroactively and
prospectively choose to deem waived or otherwise exclude such Section(s) of
the License, but only in their entirety and only with respect to the Combined
Software.

==============================================================================
Software from third parties included in the Beman Project:
==============================================================================
The Beman Project contains third party software which is under different license
terms. All such code will be identified clearly using at least one of two
mechanisms:
1) It will be in a separate directory tree with its own `LICENSE.txt` or
`LICENSE` file at the top containing the specific license and restrictions
which apply to that software, or
2) It will contain specific license and restriction terms at the top of every
file.
6 changes: 4 additions & 2 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

<!-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -->

This repository contains the infrastructure for The Beman Project. This is NOT a library repository, so it does not
respect the usual structure of a Beman library repository nor The Beman Standard!
[![beman-tidy tests](https://github.com/bemanproject/infra/actions/workflows/beman-tidy.yml/badge.svg)](https://github.com/bemanproject/infra/actions/workflows/beman-tidy.yml)

This repository contains the infrastructure for The Beman Project. This is NOT a library repository,
so it does not respect the usual structure of a Beman library repository nor The Beman Standard!

## Description

Expand Down
3 changes: 1 addition & 2 deletions infra/cmake/msvc-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ set(CMAKE_CXX_COMPILER cl)
if(BEMAN_BUILDSYS_SANITIZER STREQUAL "MaxSan")
# /Zi flag (add debug symbol) is needed when using address sanitizer
# See C5072: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-c5072
set(SANITIZER_FLAGS "/Zi")
# set(SANITIZER_FLAGS "/fsanitize=address /Zi")
set(SANITIZER_FLAGS "/fsanitize=address /Zi")
endif()

set(CMAKE_CXX_FLAGS_DEBUG_INIT "/EHsc /permissive- ${SANITIZER_FLAGS}")
Expand Down
Loading
Loading