Lint Code Base and Check Website Links #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint Code Base and Check Website Links | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '5 4 2,16 * *' | |
permissions: read-all | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Lint Code Base and Check Website Links | |
runs-on: ubuntu-latest | |
steps: | |
# CHECKOUT CODE | |
- id: checkout-code | |
name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# Full git history is needed to get a proper list | |
# of changed files within `super-linter` | |
fetch-depth: 0 | |
# LINT CODE | |
- id: read-env | |
name: Use super-linter environmental variables | |
shell: bash | |
run: | | |
# Use super-linter environmental variables | |
cat .github/super-linter.env >> "$GITHUB_ENV" | |
- id: lint-code-base | |
name: Lint Code Base | |
uses: github/super-linter/slim@v7 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEFAULT_BRANCH: main | |
# SETUP BUILD ENVIRONMENT | |
- id: setup-java | |
name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 8 | |
cache: maven | |
server-id: sonatype-nexus | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- id: install-graphviz | |
name: Install Graphviz | |
uses: sualeh/[email protected] | |
# BUILD FOR DISTRIBUTION | |
- id: build | |
name: Build and test for distribution | |
shell: bash | |
run: | | |
# Build | |
mvn \ | |
--no-transfer-progress \ | |
--batch-mode \ | |
-Ddistrib \ | |
clean install | |
# CHECK WEBSITE LINKS | |
- id: check-links | |
name: Check website links | |
uses: lycheeverse/[email protected] | |
with: | |
args: > | |
--verbose | |
--accept 200,999 | |
--no-progress | |
--base . | |
--exclude '.*purl.org/.*' | |
--exclude '.*.vimeo.com/.*' | |
'./schemacrawler-website/target/_website/**/*.html' | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- id: upload-link-check-report | |
name: Upload website link check report | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./lychee/out.md | |
name: website-link-check-report.md | |
retention-days: 15 |