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
1 change: 1 addition & 0 deletions .github/linters/.clang-format
1 change: 1 addition & 0 deletions .github/linters/.markdown-lint.yml
1 change: 1 addition & 0 deletions .github/linters/.yaml-lint.yml
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions: { }

jobs:
build:
name: Lint
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

- name: Super-linter
uses: super-linter/super-linter/slim@v6.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# External doxygen style files, the MOOSE Doxygen header, and the CodeCov upload script
# do not meet Canary linting requirements; exclude them from lint checks:
FILTER_REGEX_EXCLUDE: ((^|/)doxygen-awesome|moose_doxy_header.html|doxygen.css|tabs.css|codecov.sh)
VALIDATE_ANSIBLE: false
VALIDATE_CHECKOV: false
VALIDATE_CPP: false
VALIDATE_JSCPD: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
VALIDATE_PYTHON_PYLINT: false
VALIDATE_PYTHON_RUFF: false
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: BuildTest
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
docker-build-test-ubuntu:
runs-on: ubuntu-latest
name: RunCanaryTests
env:
PRCOMMITSHA: ${{ github.event.pull_request.head.sha }}
PRREPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: PrintGithubContext
run: echo "${PRCOMMITSHA:-$GITHUB_SHA}" "${PRREPOSITORY:-$GITHUB_REPOSITORY}"
- name: Setup Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.3.6
- name: Pull MOOSE apptainer container
run: apptainer build moose-dev-openmpi.sif oras://ghcr.io/idaholab/apptainer/moose-dev-openmpi-x86_64:latest
- name: Create apptainer instance
run: apptainer instance start moose-dev-openmpi.sif moose_instance
- name: Checkout Canary
run: apptainer exec instance://moose_instance "git clone https://github.com/aurora-multiphysics/canary.git && cd canary && git checkout ${{ github.event.pull_request.head.sha }}"
- name: Checkout MOOSE
run: apptainer exec instance://moose_instance "git clone https://github.com/idaholab/moose.git"
- name: Build MOOSE test executable
run: apptainer exec instance://moose_instance "cd moose && ./configure --with-mfem && export MOOSE_JOBS=4 && cd test && make -j4"
- name: Run Canary tests
run: apptainer exec instance://moose_instance "export MOOSE_DIR=$PWD/moose && ./canary/run_tests"
- name: Close apptainer instance
run: apptainer instance stop moose_instance
35 changes: 35 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
###########################
###########################
## Markdown Linter rules ##
###########################
###########################

# Linter rules doc:
# - https://github.com/DavidAnson/markdownlint
#
# Note:
# To comment out a single error:
# <!-- markdownlint-disable -->
# any violations you want
# <!-- markdownlint-restore -->
#

###############
# Rules by id #
###############
MD004: false # Unordered list style
MD007:
indent: 2 # Unordered list indentation
MD013:
line_length: 130 # Line length 80 is far too short
MD026:
punctuation: ".,;:!。,;:" # List of not allowed
MD029: false # Ordered list item prefix
MD033: false # Allow inline HTML
MD041: false # Allow MOOSE configuration data before first heading

#################
# Rules by tags #
#################
blank_lines: false # Error on blank lines
64 changes: 64 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format

# Not yet figured out how to configure this properly
# - repo: https://github.com/pocc/pre-commit-hooks
# rev: v1.3.5
# hooks:
# - id: clang-tidy
# args:
# - "-p=./build"
# - "-config-file=./.clang-tidy"
# - "--warnings-as-errors=*"
# - "-extra-arg=-std=c++17"
# - "-extra-arg=-stdlib=libstdc++"

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.3
hooks:
- id: editorconfig-checker
alias: ec

- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
hooks:
- id: shfmt

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck

# Hadolint isn't trivial to install
# - repo: https://github.com/hadolint/hadolint
# rev: v2.12.0
# hooks:
# - id: hadolint

# Note: needs node.js >= 18, which is more recent than version
# distributed with Ubuntu 22.4. The latest versions of node.js can
# be installed using the instructions at
# https://github.com/nodesource/distributions?tab=readme-ov-file#debian-and-ubuntu-based-distributions
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint-fix

- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
hooks:
- id: actionlint

- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint

- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.1
hooks:
- id: gitleaks
62 changes: 62 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
###########################################
# These are the rules used for #
# linting all the yaml files in the stack #
# NOTE: #
# You can disable line with: #
# # yamllint disable-line #
###########################################
rules:
braces:
level: warning
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: 1
max-spaces-inside-empty: 5
brackets:
level: warning
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: 1
max-spaces-inside-empty: 5
colons:
level: warning
max-spaces-before: 0
max-spaces-after: 1
commas:
level: warning
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments: disable
comments-indentation: disable
document-end: disable
document-start:
level: warning
present: true
empty-lines:
level: warning
max: 2
max-start: 0
max-end: 0
hyphens:
level: warning
max-spaces-after: 1
indentation:
level: warning
spaces: consistent
indent-sequences: true
check-multi-line-strings: false
key-duplicates: enable
line-length:
level: warning
max: 100
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable

ignore:
- syntax.yaml
24 changes: 0 additions & 24 deletions include/base/CanaryApp.h

This file was deleted.

5 changes: 4 additions & 1 deletion run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ MOOSE_DIR = os.environ.get('MOOSE_DIR', MOOSE_DIR)

sys.path.append(os.path.join(MOOSE_DIR, 'python'))

test_executable_path = os.path.join(MOOSE_DIR, 'test', 'moose_test')
print('Test executable path: ', test_executable_path)

from TestHarness import TestHarness
TestHarness.buildAndRun(sys.argv, 'canary', MOOSE_DIR)
TestHarness.buildAndRun(sys.argv, test_executable_path, MOOSE_DIR)
26 changes: 0 additions & 26 deletions scripts/install-format-hook.sh

This file was deleted.

51 changes: 0 additions & 51 deletions src/base/CanaryApp.C

This file was deleted.

18 changes: 0 additions & 18 deletions src/main.C

This file was deleted.

Loading