From 9411c2b1b1ad31426a126f9eeea9336595c97b0d Mon Sep 17 00:00:00 2001 From: Stephan Schnabel Date: Fri, 2 Sep 2022 10:30:37 +0200 Subject: [PATCH] Maintain actions (#71) --- .github/dependabot.yml | 4 +- .github/workflows/ci.yaml | 61 ++++++++++++++++++++++++++++++ .github/workflows/codeql.yaml | 22 ----------- .github/workflows/dependabot.yaml | 6 +-- .github/workflows/lint.yaml | 26 ------------- .github/workflows/pullrequest.yaml | 26 ------------- .github/workflows/release.yaml | 8 ++-- .github/workflows/snapshot.yaml | 35 ----------------- .markdownlint.yaml | 9 +++-- .yamllint | 9 +++++ 10 files changed, 85 insertions(+), 121 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/codeql.yaml delete mode 100644 .github/workflows/lint.yaml delete mode 100644 .github/workflows/pullrequest.yaml delete mode 100644 .github/workflows/snapshot.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f12985f..ce15cea 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,10 +3,10 @@ updates: - package-ecosystem: maven directory: / schedule: - interval: monthly + interval: daily ignore: - dependency-name: ch.qos.logback:logback-classic - update-types: ["version-update:semver-major", "version-update:semver-minor"] + update-types: [version-update:semver-major, version-update:semver-minor] - package-ecosystem: github-actions directory: / schedule: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..b40100f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,61 @@ +name: CI + +on: + push: + branches: [main] + pull_request: {} + schedule: [cron: 0 0 * * 1-5] + +jobs: + + yaml: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ibiqlik/action-yamllint@v3 + with: + format: colored + strict: true + + markdown: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: avto-dev/markdown-lint@v1 + with: + args: /github/workspace + + codeql: + runs-on: ubuntu-latest + permissions: + security-events: write + actions: read + contents: read + steps: + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v2 + with: + languages: java + - uses: github/codeql-action/autobuild@v2 + - uses: github/codeql-action/analyze@v2 + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + cache: maven + server-id: sonatype-nexus + server-username: SERVER_USERNAME + server-password: SERVER_PASSWORD + - run: mvn -B -ntp dependency:go-offline + - run: mvn -B -ntp verify + if: ${{ github.ref != 'refs/heads/main' }} + - run: mvn -B -ntp deploy + if: ${{ github.ref == 'refs/heads/main' }} + env: + SERVER_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + SERVER_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml deleted file mode 100644 index d0913c3..0000000 --- a/.github/workflows/codeql.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: CodeQL - -"on": - workflow_dispatch: {} - pull_request: {} - schedule: - - cron: '0 0 * * *' - -jobs: - codeql: - runs-on: ubuntu-latest - permissions: - security-events: write - actions: read - contents: read - steps: - - uses: actions/checkout@v3 - - uses: github/codeql-action/init@v2 - with: - languages: java - - uses: github/codeql-action/autobuild@v2 - - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/dependabot.yaml b/.github/workflows/dependabot.yaml index bcbe4a7..ed63eca 100644 --- a/.github/workflows/dependabot.yaml +++ b/.github/workflows/dependabot.yaml @@ -1,6 +1,6 @@ name: Dependabot -"on": pull_request_target +on: pull_request_target jobs: auto-merge: @@ -9,9 +9,9 @@ jobs: steps: - run: gh pr review --approve "$PR_URL" env: - PR_URL: ${{github.event.pull_request.html_url}} + PR_URL: ${{ github.event.pull_request.html_url }} GITHUB_TOKEN: ${{ secrets.GIT_ACTION_TOKEN }} - run: gh pr merge --auto --squash "$PR_URL" env: - PR_URL: ${{github.event.pull_request.html_url}} + PR_URL: ${{ github.event.pull_request.html_url }} GITHUB_TOKEN: ${{ secrets.GIT_ACTION_TOKEN }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index fa10df9..0000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint - -"on": - workflow_dispatch: {} - push: - branches: [main] - pull_request: {} - -jobs: - - yaml: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ibiqlik/action-yamllint@v3 - with: - format: colored - strict: true - - markdown: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: avto-dev/markdown-lint@v1 - with: - args: /github/workspace diff --git a/.github/workflows/pullrequest.yaml b/.github/workflows/pullrequest.yaml deleted file mode 100644 index f5e7588..0000000 --- a/.github/workflows/pullrequest.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: PullRequest - -"on": pull_request - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 11 - cache: maven - - run: mvn -B dependency:go-offline - - run: mvn -B verify - - uses: dorny/test-reporter@v1.5.0 - if: failure() - with: - name: surefire - path: '**/target/surefire-reports/*.xml,**/target/invoker-reports/*.xml' - reporter: java-junit - list-suites: failed - list-tests: failed - fail-on-error: false diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1ac888f..4f561a0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,6 +1,6 @@ name: Release -"on": workflow_dispatch +on: workflow_dispatch jobs: build: @@ -25,9 +25,9 @@ jobs: server-password: SERVER_PASSWORD gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: GPG_PASSPHRASE - - run: mvn -B dependency:go-offline - - run: mvn -B release:prepare - - run: mvn -B release:perform + - run: mvn -B -ntp dependency:go-offline + - run: mvn -B -ntp release:prepare + - run: mvn -B -ntp release:perform env: SERVER_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} SERVER_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml deleted file mode 100644 index 2bee99b..0000000 --- a/.github/workflows/snapshot.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Snapshot - -"on": - workflow_dispatch: {} - push: - branches: [main] - paths-ignore: ['**.md'] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 11 - cache: maven - server-id: sonatype-nexus - server-username: SERVER_USERNAME - server-password: SERVER_PASSWORD - - run: mvn -B dependency:go-offline - - run: mvn -B deploy - env: - SERVER_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - SERVER_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - - uses: dorny/test-reporter@v1.5.0 - if: failure() - with: - name: surefire - path: '**/target/surefire-reports/*.xml' - reporter: java-junit - list-suites: failed - list-tests: failed - fail-on-error: false diff --git a/.markdownlint.yaml b/.markdownlint.yaml index dd23793..5f08047 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,6 +1,9 @@ # Default state for all rules default: true -# MD013/line-length - Line length -MD013: - line_length: 10000 +# MD009 - Trailing spaces +MD009: + strict: true + +# MD013 - Line length +MD013: false diff --git a/.yamllint b/.yamllint index 9d1b12e..8011808 100644 --- a/.yamllint +++ b/.yamllint @@ -8,3 +8,12 @@ rules: # line length is not important line-length: disable + + # force double quotes everywhere + quoted-strings: + quote-type: double + required: only-when-needed + + # allow everything on keys + truthy: + check-keys: false