Skip to content

Commit

Permalink
feat: change ci\cd to 2 jobs, add html report and github pages scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
TomatoVan committed Mar 24, 2024
1 parent 84824d1 commit 2194960
Showing 1 changed file with 88 additions and 19 deletions.
107 changes: 88 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,117 @@
#name: linting, testing, building
#on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
#jobs:
# pipeline:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [ 17.x ]
#
# steps:
# - uses: actions/checkout@v2
# - name: Staring Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - name: install modules
# run: npm ci --force
# - name: build production project
# run: npm run build:prod
# if: always()
# - name: linting typescript
# run: npm run lint:ts
# if: always()
# - name: linting css
# run: npm run lint:scss
# - name: unit testing
# if: always()
# run: npm run test:unit
# - name: build storybook
# run: npm run storybook:build
# if: always()
# - name: screenshot testing
# run: npm run test:ui:ci
# if: always()

name: linting, testing, building
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
pipeline:
build-and-ui-testing:
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
strategy:
matrix:
node-version: [ 17.x ]

steps:
- uses: actions/checkout@v2
- name: Staring Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: install modules
run: npm install

run: npm ci --force
- name: build production project
if: always()
run: npm run build:prod
if: always()
- name: build storybook
run: npm run storybook:build
if: always()
- name: screenshot testing
run: npm run test:ui:ci
if: always()
- name: Generate HTML report
run: npm run test:ui:report
if: always()
- name: Setup Pages
uses: actions/configure-pages@v2
if: always()
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
if: always()
with:
path: '.loki'
- name: Deploy to GitHub Pages
id: deployment
if: always()
uses: actions/deploy-pages@v1

checks:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 17.x ]
steps:
- uses: actions/checkout@v2
- name: Staring Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: install modules
run: npm ci --force
- name: linting typescript
if: always()
run: npm run lint:ts

- name: linting css
if: always()
- name: linting css
run: npm run lint:scss

- name: unit testing
if: always()
run: npm run test:unit

- name: build storybook
if: always()
run: npm run storybook:build

- name: screenshot testing
if: always()
run: npm run test:ui:ci


0 comments on commit 2194960

Please sign in to comment.