Skip to content

Commit 7a8ce81

Browse files
authored
ci: longer timeout, break out lint checks to own yml (#382)
* ci: longer timeout, break out lint checks to own yml * fix: broken command * ci: have lint run on push as well * ci: fix lint yml * ci: fix matrix * ci: add names * ci: unnecessary matrix + change to latest ubuntu * ci: revert and change the *right* runs-on * ci: only run tests once * ci: all latest
1 parent e750a79 commit 7a8ce81

File tree

5 files changed

+76
-41
lines changed

5 files changed

+76
-41
lines changed

.github/workflows/deploy_docs.yml renamed to .github/workflows/deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Publish documentation on GitHub Pages
33
on: workflow_dispatch
44

55
jobs:
6-
authorize:
6+
authorize:
77
name: Authorize
8-
runs-on: ubuntu-18.04
8+
runs-on: ubuntu-latest
99
steps:
1010
- name: ${{ github.actor }} permission check to do a release
1111
uses: octokit/request-action@v2.0.0
@@ -17,7 +17,7 @@ jobs:
1717

1818
gh-pages:
1919
name: Publish to GitHub Pages
20-
runs-on: ubuntu-18.04
20+
runs-on: ubuntu-latest
2121
needs: [authorize]
2222

2323
steps:

.github/workflows/lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-check:
7+
name: Check for ESLint + Prettier Violations
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Check out Git repository
12+
uses: actions/checkout@v2
13+
14+
- name: node_modules cache
15+
uses: actions/cache@v2
16+
with:
17+
path: '**/node_modules'
18+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
yarn install --frozen-lockfile --network-timeout 300000
28+
29+
- name: Prettier check
30+
run: |
31+
yarn run lint:prettier
32+
33+
- name: Eslint check
34+
run: |
35+
yarn run lint:eslint

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name: Release
22

3-
on:
3+
on:
44
workflow_dispatch:
55
inputs:
66
dryRun:
7-
description: 'Do a dry run to preview instead of a real release'
7+
description: 'Do a dry run to preview instead of a real release'
88
required: true
99
default: 'true'
1010

1111
jobs:
12-
authorize:
12+
authorize:
1313
name: Authorize
14-
runs-on: ubuntu-18.04
14+
runs-on: ubuntu-latest
1515
steps:
1616
- name: ${{ github.actor }} permission check to do a release
1717
uses: octokit/request-action@v2.0.0
@@ -23,7 +23,7 @@ jobs:
2323

2424
release:
2525
name: Release
26-
runs-on: ubuntu-18.04
26+
runs-on: ubuntu-latest
2727
needs: [authorize]
2828
env:
2929
GIT_AUTHOR_NAME: amplitude-sdk-bot
@@ -66,7 +66,7 @@ jobs:
6666
- name: Run tests
6767
run: make test
6868

69-
- name: Release --dry-run # Uses release.config.js
69+
- name: Release --dry-run # Uses release.config.js
7070
if: ${{ github.event.inputs.dryRun == 'true'}}
7171
env:
7272
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/semantic-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
pr-title-check:
99
name: Check PR for semantic title
10-
runs-on: ubuntu-18.04
10+
runs-on: ubuntu-latest
1111
steps:
1212
- name: PR title is valid
1313
if: >

.github/workflows/test.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
name: Test
22

3-
on: [push, pull_request]
3+
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
411

512
jobs:
613
test:
14+
name: Execute full unit test suite
715
strategy:
816
fail-fast: false
917
matrix:
1018
node-version: [10.x, 12.x, 14.x]
11-
os: [macos-10.14, ubuntu-18.04]
19+
os: [macOS-latest, ubuntu-latest]
1220
runs-on: ${{ matrix.os }}
1321

1422
steps:
15-
- name: Check out Git repository
16-
uses: actions/checkout@v2
17-
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-
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v1
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
29-
- name: yarn install
30-
run: |
31-
yarn install --frozen-lockfile
32-
33-
- name: prettier check
34-
run: |
35-
yarn run lint:prettier
36-
37-
- name: eslint check
38-
run: |
39-
yarn run lint:eslint
40-
41-
- name: Build and run tests
42-
run: |
43-
make test
23+
- name: Check out Git repository
24+
uses: actions/checkout@v2
25+
26+
- name: node_modules cache
27+
uses: actions/cache@v2
28+
with:
29+
path: '**/node_modules'
30+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
31+
32+
- name: Use Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
37+
- name: Install dependencies
38+
run: |
39+
yarn install --frozen-lockfile --network-timeout 300000
40+
41+
- name: Build and run tests
42+
run: |
43+
make test

0 commit comments

Comments
 (0)