Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Publish documentation on GitHub Pages
on: workflow_dispatch

jobs:
authorize:
authorize:
name: Authorize
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: ${{ github.actor }} permission check to do a release
uses: octokit/request-action@v2.0.0
Expand All @@ -17,7 +17,7 @@ jobs:

gh-pages:
name: Publish to GitHub Pages
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: [authorize]

steps:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint

on: pull_request

jobs:
lint-check:
name: Check for ESLint + Prettier Violations
runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want ubuntu-latest over ubuntu-18.04?

Copy link
Contributor Author

@kelvin-lu kelvin-lu Apr 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ubuntu-latest is 20, not 18 actually. I changed it here since the environment of the linting probably did not matter as much as the actual unit test suite.

Do you have a preference between either? The reason I made this change for mac/ubuntu is cuz the Node SDK actions gave me a warning when I was running not the latest version when I was shoring up the tests there


steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: node_modules cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
yarn install --frozen-lockfile --network-timeout 300000
- name: Prettier check
run: |
yarn run lint:prettier
- name: Eslint check
run: |
yarn run lint:eslint
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Release

on:
on:
workflow_dispatch:
inputs:
dryRun:
description: 'Do a dry run to preview instead of a real release'
description: 'Do a dry run to preview instead of a real release'
required: true
default: 'true'

jobs:
authorize:
authorize:
name: Authorize
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: ${{ github.actor }} permission check to do a release
uses: octokit/request-action@v2.0.0
Expand All @@ -23,7 +23,7 @@ jobs:

release:
name: Release
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: [authorize]
env:
GIT_AUTHOR_NAME: amplitude-sdk-bot
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Run tests
run: make test

- name: Release --dry-run # Uses release.config.js
- name: Release --dry-run # Uses release.config.js
if: ${{ github.event.inputs.dryRun == 'true'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
pr-title-check:
name: Check PR for semantic title
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: PR title is valid
if: >
Expand Down
62 changes: 31 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
name: Test

on: [push, pull_request]
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this config stop tests on non-main branches?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would stop tests on push for non-main branches, only run when they put a PR on main.

This is also an important callout - if we change our core branch name again this is another piece to maintain. thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have we changed the core branch name in the past? Is there a reason to think we might do so again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to respond here!

It changed once from master -> main, but I feel like it'd be pretty stable after that? Just the idea that the head branch can change

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Execute full unit test suite
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
os: [macos-10.14, ubuntu-18.04]
os: [macOS-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: node_modules cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: yarn install
run: |
yarn install --frozen-lockfile

- name: prettier check
run: |
yarn run lint:prettier

- name: eslint check
run: |
yarn run lint:eslint

- name: Build and run tests
run: |
make test
- name: Check out Git repository
uses: actions/checkout@v2

- name: node_modules cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
yarn install --frozen-lockfile --network-timeout 300000

- name: Build and run tests
run: |
make test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes in this block all whitespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so - just my yml linter; let me check which one i'm using