Skip to content

Commit 3348493

Browse files
authored
chore(REACH-717): split Release into separate Github Action (#97)
Separates the release action. Runs lint and tests in PR only. Update typescript config for the badge. The `yarn.lock` and `package-lock.json` files were modified on `yarn install` and `npm install` respectively. There seems to be no content change, only formatting and order of attributes.
1 parent c080d2a commit 3348493

File tree

10 files changed

+22248
-41062
lines changed

10 files changed

+22248
-41062
lines changed

.github/workflows/pr.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-lint-test:
10+
name: build-lint-test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out Git repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
21+
- name: Get yarn cache
22+
uses: actions/cache@v3
23+
id: yarn-cache
24+
with:
25+
path: |
26+
**/node_modules
27+
~/.cache
28+
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('.github/workflows/**.yml') }}
29+
30+
- name: Install Node.js dependencies
31+
if: steps.yarn-cache.outputs.cache-hit != 'true'
32+
run: yarn install --frozen-lockfile
33+
34+
- name: Build
35+
run: yarn build
36+
37+
- name: Lint
38+
run: yarn lint
39+
40+
- name: Unit tests
41+
run: yarn test:unit
42+
43+
- name: Integration tests
44+
run: (yarn server &) && sleep 1 && yarn test:integration
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
name: Build
1+
name: Release
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
7-
84
push:
95
branches:
106
- main
117
- beta
128

139
jobs:
1410
release:
15-
name: Release
11+
name: release
1612
runs-on: ubuntu-latest
1713
steps:
1814
- name: Check out Git repository
1915
uses: actions/checkout@v3
20-
with:
21-
fetch-depth: 0
22-
persist-credentials: false
23-
token: ${{ secrets.GH_TOKEN }}
2416

2517
- name: Set up Node.js
2618
uses: actions/setup-node@v3
@@ -40,15 +32,12 @@ jobs:
4032
if: steps.yarn-cache.outputs.cache-hit != 'true'
4133
run: yarn install --frozen-lockfile
4234

43-
- run: yarn lint
44-
45-
- run: yarn test:unit
46-
- run: (yarn server &) && sleep 1 && yarn test:integration
47-
48-
- run: yarn build
35+
- name: Build
36+
run: yarn build
4937

50-
- run: yarn semantic-release
38+
- name: Release
5139
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/beta') }}
40+
run: yarn semantic-release
5241
env:
5342
GH_TOKEN: ${{ secrets.GH_TOKEN }}
5443
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ dist
33
lib
44
.npmrc
55
yarn-error.log
6-
.DS_STORE
6+
.DS_STORE
7+
.idea/

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Typeform JavaScript SDK
22

3-
[![Build Status](https://travis-ci.com/Typeform/js-api-client.svg?token=nePyGZWpdyBxUnh9PswC&branch=main)](https://travis-ci.com/Typeform/js-api-client)
4-
5-
---
3+
[![Pull Request](https://github.com/Typeform/js-api-client/actions/workflows/pr.yml/badge.svg)](https://github.com/Typeform/js-api-client/actions/workflows/pr.yml)
64

75
JS Client wrapper for Typeform API
86

@@ -378,9 +376,8 @@ yarn install
378376

379377
# Runs unit tests
380378
yarn test:unit
381-
382379
```
383380

384381
## Suggestions or feedback
385382

386-
Fill out this [conversation](https://bit.ly/2wmzCXi) 🙂
383+
Feel free to [open a Github issue](https://github.com/Typeform/js-api-client/issues).

0 commit comments

Comments
 (0)