Skip to content

Commit

Permalink
Merge pull request #653 from akunzai/linting
Browse files Browse the repository at this point in the history
Set up linting
  • Loading branch information
akunzai authored Sep 14, 2024
2 parents 20a5ba6 + cdd460d commit 8668168
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0-bookworm-slim as dotnet-lts-runtime
FROM docker.io/library/mono as mono

# https://hub.docker.com/_/microsoft-dotnet-sdk/
FROM mcr.microsoft.com/dotnet/sdk:8.0

# install ASP.NET Core 6.0 Runtime
COPY --from=mcr.microsoft.com/dotnet/aspnet:6.0-bookworm-slim /usr/share/dotnet /usr/share/dotnet
COPY --from=dotnet-lts-runtime /usr/share/dotnet /usr/share/dotnet

# install msbuild for Mono
# https://hub.docker.com/_/mono/
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/keycloak/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG KEYCLOAK_VERSION=25.0.4
FROM alpine as downloader
ARG KEYCLOAK_VERSION
RUN set -eux; \
apk add curl; \
apk add --no-cache curl; \
# https://github.com/jacekkow/keycloak-protocol-cas
curl -Lo /tmp/keycloak-protocol-cas.jar https://github.com/jacekkow/keycloak-protocol-cas/releases/download/${KEYCLOAK_VERSION}/keycloak-protocol-cas-${KEYCLOAK_VERSION}.jar;

Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# https://learn.microsoft.com/aspnet/core/security/docker-compose-https#macos-or-linux
if [ -f "/https/aspnetapp.pem" ] && [ -f "/https/aspnetapp.key" ]; then
if [[ -f "/https/aspnetapp.pem" ]] && [[ -f "/https/aspnetapp.key" ]]; then
cat >> /home/vscode/.bashrc <<EOF
export ASPNETCORE_Kestrel__Certificates__Default__Path="/https/aspnetapp.pem"
export ASPNETCORE_Kestrel__Certificates__Default__KeyPath="/https/aspnetapp.key"
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
branches:
- main
paths:
- '**/*.md'
- '**/*.sh'
- '**/Dockerfile'
- '.github/workflows/*.yml'
pull_request:
branches:
- main
paths:
- '**/*.md'
- '**/*.sh'
- '**/Dockerfile'
- '.github/workflows/*.yml'

jobs:
build:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint Markdown
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: '**/*.md'
- name: Lint Dockerfile
uses: reviewdog/action-hadolint@v1
- name: Lint shell script
uses: reviewdog/action-shellcheck@v1
- name: Lint GitHub Actions workflow
uses: reviewdog/action-actionlint@v1
6 changes: 6 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
ignored:
- DL3006
- DL3008
- DL3018
- DL4006
6 changes: 6 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json",
"config": {
"line-length": false
}
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# GSS.Authentication.CAS

[![Build Status][build-badge]][build] [![Code Coverage][codecov-badge]][codecov]
[![Build Status][build-badge]][build] [![Code Coverage][codecov-badge]][codecov] [![Lint][lint-badge]][lint]

[build]: https://github.com/akunzai/GSS.Authentication.CAS/actions/workflows/build.yml
[build-badge]: https://github.com/akunzai/GSS.Authentication.CAS/actions/workflows/build.yml/badge.svg
[codecov]: https://codecov.io/gh/akunzai/GSS.Authentication.CAS
[codecov-badge]: https://codecov.io/gh/akunzai/GSS.Authentication.CAS/branch/main/graph/badge.svg?token=JGG7Y07SR0
[lint]: https://github.com/akunzai/GSS.Authentication.CAS/actions/workflows/lint.yml
[lint-badge]: https://github.com/akunzai/GSS.Authentication.CAS/actions/workflows/lint.yml/badge.svg

CAS Authentication Middleware for OWIN & ASP.NET Core

Expand Down

0 comments on commit 8668168

Please sign in to comment.