Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up various badges for the repository #2

Merged
merged 26 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9586d63
Trying to add code coverage reporting to CI
cmacmackin Jun 4, 2024
f4c9da6
Fixed typo in CI
cmacmackin Jun 4, 2024
3c12cef
Fix coverage upload script
cmacmackin Jun 4, 2024
bd1a372
Trying to fix coverage upload
cmacmackin Jun 4, 2024
ecda872
More attempts at fixing
cmacmackin Jun 4, 2024
317946d
Trying to use old approach to upload codecov
cmacmackin Jun 4, 2024
513af5d
Added support for clang-format linting
cmacmackin Jun 5, 2024
f6e0bb4
Another attempt to upload coverage data
cmacmackin Jun 5, 2024
0f1a51b
Add a couple initial badges to the README
cmacmackin Jun 5, 2024
afd9035
Applied shellcheck linting
cmacmackin Jun 7, 2024
8df4908
Adjusted path to coverage upload script
cmacmackin Jun 7, 2024
86f5405
Configured linters and tried to correct issues with them
cmacmackin Jun 7, 2024
5cddb1a
Fixed path to upload script
cmacmackin Jun 7, 2024
a465503
Applied shfmt
cmacmackin Jun 7, 2024
6b66e2b
Applied clang-format
cmacmackin Jun 7, 2024
dc2c3af
Ignore some unavoidable hadolint errors
cmacmackin Jun 7, 2024
b3b7b0c
Fix YAML formatting
cmacmackin Jun 7, 2024
40e5b30
Fixed very long line
cmacmackin Jun 7, 2024
a3d9408
Fixed a few more YAML formatting errors
cmacmackin Jun 7, 2024
b2fe79c
Fixed remaining shellcheck errors
cmacmackin Jun 7, 2024
6295346
Fixed a few more formatting errors in bash script
cmacmackin Jun 7, 2024
f4f1027
Build with coverage flags
cmacmackin Jun 7, 2024
662d4ed
Added pre-commit hooks for same linters as used in CI
cmacmackin Jun 7, 2024
4249c12
Fixed remaining issues with pre-commit hooks/linting
cmacmackin Jun 10, 2024
7412701
Trying (yet again) to upload to codecov
cmacmackin Jun 11, 2024
915351c
Added two more badges
cmacmackin Jun 12, 2024
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
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[*.sh]
indent_style = space
indent_size = 4
space_redirects = true
keep_padding = true
never_split = true

[unit/run_tests]
indent_style = space
indent_size = 4
space_redirects = true
keep_padding = true
never_split = true
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
46 changes: 46 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
24 changes: 17 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
---
name: BuildTest
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main

jobs:
docker-build-test-ubuntu:
runs-on: ubuntu-latest
name: BuildTestUbuntu
env:
PRCOMMITSHA : ${{ github.event.pull_request.head.sha }}
PRCOMMITSHA: ${{ github.event.pull_request.head.sha }}
PRREPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
steps:
# First check out the repository to get the docker file
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
# Print the context for this GitHub workflow
- name: PrintGithubContext
run: echo ${PRCOMMITSHA:-$GITHUB_SHA} ${PRREPOSITORY:-$GITHUB_REPOSITORY}
run: echo "${PRCOMMITSHA:-$GITHUB_SHA}" "${PRREPOSITORY:-$GITHUB_REPOSITORY}"
# Now build in a container with all deps
- name: DockerBuildTest
run: |
docker build -t ci-platypus-ubuntu \
--build-arg build_git_sha=${PRCOMMITSHA:-$GITHUB_SHA} \
--build-arg build_git_repo=${PRREPOSITORY:-$GITHUB_REPOSITORY} \
--build-arg build_git_sha="${PRCOMMITSHA:-$GITHUB_SHA}" \
--build-arg build_git_repo="${PRREPOSITORY:-$GITHUB_REPOSITORY}" \
--build-arg coverage=true \
docker/platypus
- name: UploadCoverage
run: |
ci_env=$(bash <(curl -s https://codecov.io/env))
# shellcheck disable=SC2086
docker run $ci_env -e CI=true ci-platypus-ubuntu:latest \
bash /opt/platypus/scripts/upload-coverage.sh
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/weekly_build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: Publish Docker Images
on:
workflow_dispatch:
schedule:
# Schedule to update image every Monday morning at 04:00.
- cron: '00 4 * * 1'
- cron: '00 4 * * 1'

jobs:
push-platypus-deps-image-to-docker-hub:
Expand Down
140 changes: 0 additions & 140 deletions .gitlab-ci.yml

This file was deleted.

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: 100 # 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
73 changes: 63 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,64 @@
---
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format

- 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/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
Loading