generated from DTS-STN/next-template
-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (59 loc) · 2.4 KB
/
test-and-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Lint and Test
on:
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.1
cache: yarn
- name: Install
run: yarn install --immutable
- name: Build
run: yarn run build
env:
ADOBE_ANALYTICS_URL: ${{ secrets.ADOBE_ANALYTICS_URL }}
- name: Lint
run: yarn run lint
- name: Run Unit Tests and Coverage
run: yarn run test:ci
# - name: Extract branch name
# shell: bash
# run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
# id: extract_branch
# - name: Deploy Coverage Report 🚀
# uses: JamesIves/[email protected]
# with:
# TARGET_FOLDER: ${{ steps.extract_branch.outputs.branch }}/coverage
# BRANCH: gh-pages # The branch the action should deploy to.
# FOLDER: coverage
# - name: Find Comment
# if: steps.extract_branch.outputs.branch != 'main'
# uses: peter-evans/find-comment@v1
# id: fc
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-author: 'github-actions[bot]'
# body-includes: |
# Jest Coverage Report Link for Branch
# https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ steps.extract_branch.outputs.branch }}/coverage/lcov-report
# - name: Create or update comment # comment in pull request
# if: steps.extract_branch.outputs.branch != 'main'
# uses: peter-evans/create-or-update-comment@v1
# with:
# comment-id: ${{ steps.fc.outputs.comment-id }}
# issue-number: ${{ github.event.pull_request.number }}
# body: |
# Jest Coverage Report Link for Branch
# https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ steps.extract_branch.outputs.branch }}/coverage/lcov-report
# edit-mode: replace