Skip to content

Commit 555ddb6

Browse files
authored
ci: cache, macOS, and docs (#304)
* Removed unused circleci test, replaced badge on README with github workflow * Add cache step to node modules to speed up CI * Enable macOS test environments in CI * Cleaned up PR templates
1 parent 3da9633 commit 555ddb6

File tree

7 files changed

+70
-21
lines changed

7 files changed

+70
-21
lines changed

.circleci/config.yml

-13
This file was deleted.

.github/pull_request_template.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ Thanks for contributing to the Amplitude JavaScript SDK! 🎉
33
44
Please fill out the following sections to help us quickly review your pull request.
55
--->
6+
67
### Summary
78

89
<!-- What does the PR do? -->
910

1011
### Checklist
1112

12-
* [ ] Does your PR title have the correct [title format](../CONTRIBUTING.md#pr-commit-title-conventions)
13-
* [ ] Does your PR have a breaking change?
13+
* [ ] Does your PR title have the correct [title format](../CONTRIBUTING.md#pr-commit-title-conventions)?
14+
* Does your PR have a breaking change?: <!-- Yes or no -->

.github/workflows/release.yml

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ jobs:
3636
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3737
aws-region: ${{ secrets.AWS_REGION }}
3838

39+
- name: node_modules cache
40+
uses: actions/cache@v2
41+
with:
42+
path: '**/node_modules'
43+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
44+
3945
- name: Set up Python
4046
uses: actions/setup-python@v2
4147
with:

.github/workflows/semantic-pr.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Semantic PR title
2+
3+
name: Test
4+
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, edited]
8+
9+
jobs:
10+
pr-title-check:
11+
name: Check PR for semantic title
12+
runs-on: ubuntu-18.04
13+
steps:
14+
- name: PR title is valid
15+
if: >
16+
startsWith(github.event.pull_request.title, 'feat:') || startsWith(github.event.pull_request.title, 'feat(') ||
17+
startsWith(github.event.pull_request.title, 'fix:') || startsWith(github.event.pull_request.title, 'fix(') ||
18+
startsWith(github.event.pull_request.title, 'perf:') || startsWith(github.event.pull_request.title, 'perf(') ||
19+
startsWith(github.event.pull_request.title, 'docs:') || startsWith(github.event.pull_request.title, 'docs(') ||
20+
startsWith(github.event.pull_request.title, 'test:') || startsWith(github.event.pull_request.title, 'test(') ||
21+
startsWith(github.event.pull_request.title, 'refactor:') || startsWith(github.event.pull_request.title, 'refactor(') ||
22+
startsWith(github.event.pull_request.title, 'style:') || startsWith(github.event.pull_request.title, 'style(') ||
23+
startsWith(github.event.pull_request.title, 'build:') || startsWith(github.event.pull_request.title, 'build(') ||
24+
startsWith(github.event.pull_request.title, 'ci:') || startsWith(github.event.pull_request.title, 'ci(') ||
25+
startsWith(github.event.pull_request.title, 'chore:') || startsWith(github.event.pull_request.title, 'chore(') ||
26+
startsWith(github.event.pull_request.title, 'revert:') || startsWith(github.event.pull_request.title, 'revert(') ||
27+
run: |
28+
echo 'Title checks passed'
29+
30+
- name: PR title is invalid
31+
if: >
32+
!startsWith(github.event.pull_request.title, 'feat:') && !startsWith(github.event.pull_request.title, 'feat(') &&
33+
!startsWith(github.event.pull_request.title, 'fix:') && !startsWith(github.event.pull_request.title, 'fix(') &&
34+
!startsWith(github.event.pull_request.title, 'perf:') && !startsWith(github.event.pull_request.title, 'perf(') &&
35+
!startsWith(github.event.pull_request.title, 'docs:') && !startsWith(github.event.pull_request.title, 'docs(') &&
36+
!startsWith(github.event.pull_request.title, 'test:') && !startsWith(github.event.pull_request.title, 'test(') &&
37+
!startsWith(github.event.pull_request.title, 'refactor:') && !startsWith(github.event.pull_request.title, 'refactor(') &&
38+
!startsWith(github.event.pull_request.title, 'style:') && !startsWith(github.event.pull_request.title, 'style(') &&
39+
!startsWith(github.event.pull_request.title, 'build:') && !startsWith(github.event.pull_request.title, 'build(') &&
40+
!startsWith(github.event.pull_request.title, 'ci:') && !startsWith(github.event.pull_request.title, 'ci(') &&
41+
!startsWith(github.event.pull_request.title, 'chore:') && !startsWith(github.event.pull_request.title, 'chore(') &&
42+
!startsWith(github.event.pull_request.title, 'revert:') && !startsWith(github.event.pull_request.title, 'revert(') &&
43+
run: |
44+
echo 'Pull request title is not valid. Please check github.com/amplitude/Amplitude-JavaScript/blob/master/CONTRIBUTING.md#pr-commit-title-conventions'
45+
exit 1
46+

.github/workflows/test.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ jobs:
88
fail-fast: false
99
matrix:
1010
node-version: [10.x, 12.x, 14.x]
11-
# os: [macos-10.14, ubuntu-18.04] @TODO See if MacOS test can be fixed
12-
os: [ubuntu-18.04]
11+
os: [macos-10.14, ubuntu-18.04]
1312
runs-on: ${{ matrix.os }}
1413

1514
steps:
1615
- name: Check out Git repository
1716
uses: actions/checkout@v2
1817

18+
- name: node_modules cache
19+
uses: actions/cache@v2
20+
with:
21+
path: '**/node_modules'
22+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
23+
1924
- name: Use Node.js ${{ matrix.node-version }}
2025
uses: actions/setup-node@v1
2126
with:

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ yarn dev # Start development utility. Open localhost:9000 in your browser to acc
3939

4040
### PR Commit Title Conventions
4141

42-
PR titles should follow [conventional commit standards](https://www.conventionalcommits.org/en/v1.0.0/). A [probot app](https://github.com/zeke/semantic-pull-requests) checks for this when a PR is opened. This helps automate the [release](#release) process.
42+
PR titles should follow [conventional commit standards](https://www.conventionalcommits.org/en/v1.0.0/). This helps automate the [release](#release) process.
4343

4444
#### Commit Types ([related to release conditions](#release))
4545

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
<br />
66
</p>
77

8-
[![Circle CI](https://circleci.com/gh/amplitude/Amplitude-JavaScript.svg?style=shield&circle-token=80de0dbb7632b2db13f76ccb20a79bbdfc50c215)](https://circleci.com/gh/amplitude/Amplitude-JavaScript)
9-
[![npm version](https://badge.fury.io/js/amplitude-js.svg)](https://badge.fury.io/js/amplitude-js)
10-
[![Bower version](https://badge.fury.io/bo/amplitude-js.svg)](https://badge.fury.io/bo/amplitude-js)
8+
<div align="center">
9+
10+
[![Test](https://github.com/amplitude/Amplitude-JavaScript/workflows/Test/badge.svg)](https://github.com/amplitude/Amplitude-JavaScript/actions?query=workflow%3ATest)
11+
[![npm version](https://badge.fury.io/js/amplitude-js.svg)](https://badge.fury.io/js/amplitude-js)
12+
[![Bower version](https://badge.fury.io/bo/amplitude-js.svg)](https://badge.fury.io/bo/amplitude-js)
13+
14+
</div>
1115

1216
# Official Amplitude JS/Web SDK
1317
A JavaScript SDK for tracking events and revenue to [Amplitude](https://www.amplitude.com).

0 commit comments

Comments
 (0)