Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added a link-check ci #297

Closed
wants to merge 15 commits into from
48 changes: 48 additions & 0 deletions .github/workflows/link-check.yml
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and check Links

on:
push:
branches:
- main

pull_request:
types: [opened, synchronize, reopened]

jobs:
build_and_serve:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Dependencies
run: yarn install
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved

- name: Build Next.js App
run: yarn build

- name: Serve App Locally
Copy link
Member

@aialok aialok Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to remove this steps and add this to linkchecker job as we need our app to run locally so that linkchecker can do it job.

Suggested change
- name: Serve App Locally
Remove this step

Here no need to run app locally.

Copy link
Contributor Author

@Gmin2 Gmin2 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review @aialok

no we need to first build and deploy it here and pass the deployed url in the linkchecker action (i have put localhost:3000 as of now)

The deploy step is missing here as the deployment is not yet clear

@aialok

Copy link
Member

@DarhkVoyd DarhkVoyd Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I too agree with you regarding to need to build and deploy locally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review @aialok

no we need to first build and deploy it here and pass the deployed url in the linkchecker action (i have put localhost:3000 as of now)

The deploy step is missing here as the deployment is not yet clear

@aialok

Got it man. But I still have one doubt what do you mean by deploy locally. Deploy locally means running on localhost?

Thank you @utnim2. You have done pretty good job : )

run: yarn start &

- name: Wait for App to Start
run: sleep 20

linkChecker:
Copy link
Member

@DarhkVoyd DarhkVoyd Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing jobs runs post action cleanup in workflow which closes all of our node processes from previous step which includes the one serving the site on local host. So, we should either build and serve again or simply merge them into a single job.

runs-on: ubuntu-latest
needs: build_and_serve
steps:
- uses: actions/checkout@v4
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved

Copy link
Member

@aialok aialok Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add steps to run our app locally, as we need it to run locally since most of our links are based on localhost.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment here

- name: Link Checker
uses: lycheeverse/[email protected]
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved
with:
fail: true
args: '--base http://localhost:3000 --verbose --no-progress **/*.md'
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved

# we should add here deployment steps here
1 change: 1 addition & 0 deletions .lycheeignore
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// add some link here that you dont want link-checker ci to check
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion pages/blog/posts/bowtie-intro.md
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Bowtie attempts to bring these ideas to JSON Schema.

From the existing [list of JSON Schema implementations](https://json-schema.org/implementations.html#validators), Bowtie already [supports](https://github.com/orgs/bowtie-json-schema/packages) *12* implementations across *9* programming languages, allowing anyone to run any of these implementations and see what they have to say about schemas and instances.

It ships with a [command line program](https://bowtie-json-schema.readthedocs.io/en/latest/cli/), but perhaps more excitingly, ongoing automated runs of this CLI have been set up, such that Bowtie emits a [report across all of its supported implementations](https://bowtie-json-schema.github.io/bowtie/draft2020).
It ships with a [command line program](https://docs.bowtie.report/en/stable/cli/), but perhaps more excitingly, ongoing automated runs of this CLI have been set up, such that Bowtie emits a [report across all of its supported implementations](https://bowtie-json-schema.github.io/bowtie/draft2020).
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved
Gmin2 marked this conversation as resolved.
Show resolved Hide resolved

To produce this report, Bowtie runs the [official JSON Schema Test Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite), which is our existing set of tests meant to exercise compliance with the JSON Schema specifications.
Many implementations already [use the suite within their own continuous integration](https://github.com/json-schema-org/JSON-Schema-Test-Suite#who-uses-the-test-suite), but this is the first time both users of JSON Schema as well as implementers can see results of running the suite in a single place, across many implementations.
Expand Down
Loading