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(workflow): add lint-web job #347

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,56 @@ jobs:
env:
FOLDER: ./static

lint-web:
runs-on: ubuntu-22.04
env:
WEB_PORT: 3000
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup node environment (for building)
uses: actions/setup-node@v4
with:
node-version: 16.18
cache: yarn

- name: Fetch dependencies
run: |
yarn --frozen-lockfile

- name: Start web server
run: |
yarn build
yarn serve --port $WEB_PORT --no-open &
sleep 2

- name: Create artifacts directory
run: |
mkdir -p ${{ github.workspace }}/tmp/artifacts

- name: Run Lighthouse
uses: foo-software/[email protected]
with:
prCommentEnabled: true
maxRetries: 2
outputDirectory: ${{ github.workspace }}/tmp/artifacts
device: all
urls: >-
http://localhost:${{ env.WEB_PORT }}/
gitHubAccessToken: ${{ secrets.OKP4_TOKEN }}

- name: Upload lighthouse reports
uses: actions/[email protected]
with:
name: Lighthouse reports
path: ${{ github.workspace }}/tmp/artifacts

- name: Stop web server
if: always()
run: |
kill $(lsof -t -i:$WEB_PORT)

report-new-dependencies:
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
Expand Down Expand Up @@ -151,6 +201,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 16.18
cache: yarn

- name: Fetch dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 16.18
cache: yarn

- name: Fetch dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-versioned-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 16.18
cache: yarn

- name: Bump new version
if: ${{ github.event.inputs.draft == 'false' }}
Expand Down
Loading