Skip to content

Latest commit

 

History

History
99 lines (67 loc) · 2.87 KB

README.md

File metadata and controls

99 lines (67 loc) · 2.87 KB

Walcron, a personal website

A personal website for self-learning interest.


Build Status Code Coverage

How to Use

In your terminal, run the following command:

For local execution:

npm run dev

For test with watch

npm run test

For test coverage

npm run test:ci

For linting and prettifier check

npm run lint

For BackstopJS - regression for view and approve website design UI Note: that browser executes differently in OS, especially font's. In this case use the approved generated backstopJS snapshots directly from the OS/Docker container.

npm run backstop:test  //To test
npm run backstop:approve // Approve the new website ok

Setting environments

  1. Install Vercel Cli, with npm i -g vercel
  2. Pull all the environment into local with vercel env pull .env.local. This wil create an environment straight for testing. Incase, there are reset of environment to setup in Vercel, refer to .env file.

Run Github workflows

Project is tied closely with github.

To create a new change, do a pull request. (Master is still not locked)

  1. Create a branch for changes in lowercase with no space.
  2. Commit the changes in the branch.
  3. Push.
  4. In github, create a pull request.
  5. Check that the workflow is executed without error.
  6. Merge the commit.

In case there is a need to generate a new backstopJS approved page.

  1. In github, go to Actions tab.
  2. Select 'Create Approved Snapshot By File'.
  3. Click on 'Run workflow'
  4. Enter the vercel/public website to generate an approved website domain. Without http, e.g. https://www.walcron.com to www.walcron.com
  5. Manually enter a valid branch it can checkout, e.g. develop.

Updating backstopJS snapshot.

--By pull request

  1. Download the artifacts generated in "Summary" of the latest build. Replace generated snapshot in backstopdata/bitmaps_test//!failed_.png
  2. replace into bitmaps_reference.

--By action

  1. Download the artifacts generated in latest requested workflow. Replace generated snapshot in backstop_data/bitmaps_reference/*
  2. replace into bitmaps_reference.

--Auto approval (Recommended)

  1. Get the latest pipeline no from snapshotcheck.sh output from previous failed Validation workflow.
  2. OR view latest running script in github's Actions tab for Validation workflow.
  3. Execute the command below and it will auto-approve and rerun Validation workflow again.
echo ${running no# +1} > backstopjs.approve
git add backstopjs.approve
git push