Skip to content

Commit

Permalink
Merge pull request #347 from okp4/ci/lighthouse
Browse files Browse the repository at this point in the history
ci(workflow): add lint-web job
  • Loading branch information
ccamel authored Nov 10, 2023
2 parents 47e5b30 + 53b1d6c commit 3d8026a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
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

0 comments on commit 3d8026a

Please sign in to comment.