-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (58 loc) · 1.78 KB
/
nodejs.yml
File metadata and controls
62 lines (58 loc) · 1.78 KB
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
name: Main workflow
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
if: contains(github.event.head_commit.message, '[skip ci]') == false
name: Auditing Changes
runs-on: macos-latest
strategy:
matrix:
node-version: [14.16.0]
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Git pull
run: |
git fetch origin ${{ github.head_ref }}
(git branch --list | grep ${{ github.head_ref }}) || (git checkout origin/${{ github.head_ref }} -b ${{ github.head_ref }})
# git checkout origin/${{ github.head_ref }} -b ${{ github.head_ref }}
git pull
if: github.head_ref != ''
env:
GIT_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
- name: Git pull (master)
run: |
git checkout master
git pull origin master
if: github.head_ref == ''
env:
GIT_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
- name: Setting up node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: chmod +x ./.workflow/*.sh
- run: npm install yarn@1.22.4 -g
- run: yarn
- name: Running tests
run: yarn test
- name: Auditing commit message
if: success()
run: ./.workflow/validate_last_commit_message.sh
- name: Versioning when needed (master)
if: success() && github.event_name == 'push'
run: ./.workflow/versioning.sh
env:
GIT_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
GIT_PATH: ${{ github.repository }}
env:
CI: true