Skip to content

Commit

Permalink
fix(website): vuepress-next breaking change (#3611)
Browse files Browse the repository at this point in the history
* fix: vuepress-next breaking change

See vuepress/core#1195.

Other fixes:

* fix: website js tests triggering properly
* chore: clean up test workflows
* fix: yarn packages
* fix: renovate config & medium rate limit
* fix: don't need to require docker build for JS code
* fix: muffet config
* fix: properly name website test

---------

Co-authored-by: PePe Amengual <[email protected]>
  • Loading branch information
GenPage and jamengual committed Jul 25, 2023
1 parent 4590b58 commit 70e5619
Show file tree
Hide file tree
Showing 9 changed files with 667 additions and 760 deletions.
6 changes: 6 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
],
},
packageRules: [
// For vuepress
{
"matchPackageNames": ["vuepress", "@vuepress/client", "@vuepress/markdown", "@vuepress/utils"],
"groupName": "vuepress",
"allowedVersions": "!/pre.*$/",
},
// e2e test depends on testing/Dockefile testing-image which has conftest specific version.
// to upgrade conftest versions, we need following PRs.
// 1. update testing/Dockerfile conftest version
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/atlantis-image-required.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
- '.github/workflows/atlantis-image.yml'
- '**.go'
- 'go.*'
- 'yarn.lock'
- 'package.json'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/atlantis-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ on:
- '.github/workflows/atlantis-image.yml'
- '**.go'
- 'go.*'
- 'yarn.lock'
- 'package.json'
workflow_dispatch:

concurrency:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/test-required.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,3 @@ jobs:
runs-on: ubuntu-22.04
steps:
- run: 'echo "No build required"'

website_link_check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- run: 'echo "No build required"'
38 changes: 0 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,41 +35,3 @@ jobs:
- uses: actions/checkout@v3
- run: make test-all
- run: make check-fmt

# Check that there's no missing links for the website.
# This job builds the website, starts a server to serve it, and then uses
# muffet (https://github.com/raviqqe/muffet) to perform the link check.
website_link_check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: .node-version

- name: run http-server
env:
# renovate: datasource=github-releases depName=raviqqe/muffet
MUFFET_VERSION: 2.6.3
run: |
npm install -g yarn
# http-server is used to serve the website locally as muffet checks it.
yarn global add http-server
# install raviqqe/muffet to check for broken links.
curl -L https://github.com/raviqqe/muffet/releases/download/v${MUFFET_VERSION}/muffet_${MUFFET_VERSION}_Linux_x86_64.tar.gz | tar -xz
yarn install
yarn website:build
http-server runatlantis.io/.vuepress/dist &
- name: wait until server listened
run: curl --retry-delay 1 --retry 30 --retry-all-error http://localhost:8080

- run: |
./muffet \
-e 'https://github\.com/runatlantis/atlantis/edit/main/.*' \
-e 'https://github.com/runatlantis/helm-charts#customization' \
--header 'Accept-Encoding:deflate, gzip' \
--buffer-size 8192 \
http://localhost:8080/
38 changes: 38 additions & 0 deletions .github/workflows/website-required.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: website

on:
push:
branches:
- "main"
paths-ignore:
- '**.js'
- 'yarn.lock'
- 'package.json'
- '.github/workflows/website.yml'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- "main"
paths-ignore:
- '**.js'
- 'yarn.lock'
- 'package.json'
- '.github/workflows/website.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
# Check that there's no missing links for the website.
# This job builds the website, starts a server to serve it, and then uses
# muffet (https://github.com/raviqqe/muffet) to perform the link check.
website_check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- run: 'echo "No testing required"'
69 changes: 69 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: website

on:
push:
branches:
- "main"
paths:
- '**.js'
- 'yarn.lock'
- 'package.json'
- '.github/workflows/website.yml'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- "main"
paths:
- '**.js'
- 'yarn.lock'
- 'package.json'
- '.github/workflows/website.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
# Check that the website builds and there's no missing links.
# This job builds the website, starts a server to serve it, and then uses
# muffet (https://github.com/raviqqe/muffet) to perform the link check.
link_check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: .node-version

- name: run http-server
env:
# renovate: datasource=github-releases depName=raviqqe/muffet
MUFFET_VERSION: 2.6.3
run: |
npm install -g yarn
# http-server is used to serve the website locally as muffet checks it.
yarn global add http-server
# install raviqqe/muffet to check for broken links.
curl -L https://github.com/raviqqe/muffet/releases/download/v${MUFFET_VERSION}/muffet_${MUFFET_VERSION}_Linux_x86_64.tar.gz | tar -xz
yarn install
yarn website:build
http-server runatlantis.io/.vuepress/dist &
- name: wait until server listened
run: curl --retry-delay 1 --retry 30 --retry-all-error http://localhost:8080

# medium.com => was being rate limited: HTTP 429
- run: |
./muffet \
-e 'https://medium.com/runatlantis'
-e 'https://github\.com/runatlantis/atlantis/edit/main/.*' \
-e 'https://github.com/runatlantis/helm-charts#customization' \
--header 'Accept-Encoding:deflate, gzip' \
--buffer-size 8192 \
http://localhost:8080/
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"license": "Apache-2.0",
"devDependencies": {
"@vuepress/plugin-docsearch": "^2.0.0-beta.60",
"@vuepress/plugin-google-analytics": "^2.0.0-beta.60",
"vuepress": "^2.0.0-beta.60"
"@vuepress/plugin-docsearch": "2.0.0-beta.66",
"@vuepress/plugin-google-analytics": "2.0.0-beta.66",
"vuepress": "2.0.0-beta.66"
},
"scripts": {
"website:dev": "vuepress dev runatlantis.io",
Expand Down
Loading

0 comments on commit 70e5619

Please sign in to comment.