Skip to content

Commit

Permalink
Validate links in frontend in CI (airbytehq#13600)
Browse files Browse the repository at this point in the history
* Validate doc links during building
* Add scheduled link validation
* Remove accidentally commited file
* Remove unnecessary file
* Review feedback
  • Loading branch information
timroes authored Jun 8, 2022
1 parent b4e43c2 commit 4c97893
Show file tree
Hide file tree
Showing 25 changed files with 3,722 additions and 496 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/fe-validate-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Frontend Link Validation

on:
workflow_dispatch:
schedule:
- cron: '0 14 * * *'

jobs:
validate-frontend-links:
name: "Validate frontend links"
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: "17"

- uses: actions/setup-node@v1
with:
node-version: "16.13.0"

- name: Set up CI Gradle Properties
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
- name: Run :airbyte-webapp:validateLinks
run: SUB_BUILD=PLATFORM ./gradlew --no-daemon :airbyte-webapp:validateLinks --scan

- name: Publish Failures to dev-frontend channel
uses: abinoda/slack-action@master
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
with:
args: >-
{\"channel\":\"C03088BTMFC\", \"blocks\":[
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":alarm: The periodic link validation failed!\n\n\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n\"}}]}
10 changes: 10 additions & 0 deletions airbyte-webapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ task licenseCheck(type: NpmTask) {
inputs.file 'package-lock.json'
}

task validateLinks(type: NpmTask) {
dependsOn npmInstall

args = ['run', 'validate-links']
inputs.file 'package.json'
inputs.file 'package-lock.json'
}

// Make sure to always run a license check after we installed dependencies
npmInstall.finalizedBy licenseCheck
// Validate all links after installing dependencies
npmInstall.finalizedBy validateLinks
assemble.dependsOn npm_run_build
build.finalizedBy test

Expand Down
Loading

0 comments on commit 4c97893

Please sign in to comment.