Skip to content

Commit

Permalink
feat: update jest to v27, as well as misc dependencies (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah committed Mar 28, 2022
1 parent 5650b7a commit 4633ab8
Show file tree
Hide file tree
Showing 75 changed files with 9,688 additions and 23,141 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = off

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab

[{CHANGELOG.md,package.json,yarn.lock}]
indent_size = false
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
website
!.eslintrc.js
node_modules
.yarn
dist
/output

**/.*
**/dist
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
root: true,
extends: ['@tophat/eslint-config/base', '@tophat/eslint-config/jest'],
rules: {
'prettier/prettier': [
'error',
{
printWidth: 100,
tabWidth: 4,
semi: false,
trailingComma: 'all' /* Reduces git diff. */,
singleQuote: true,
arrowParens: 'always', // Reduces character diff when adding Typescript types.
},
],
'@typescript-eslint/no-non-null-assertion': 'off',
'no-empty': ['error', { allowEmptyCatch: true }]
}
}
15 changes: 0 additions & 15 deletions .github/actions/lint/action.yml

This file was deleted.

117 changes: 93 additions & 24 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,48 @@ on:
push:
branches:
- master
- next
pull_request:
workflow_dispatch:

env:
CI: 1

jobs:
client:
static-analysis:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./client/node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('./client/yarn.lock') }}
- name: lint client
uses: ./.github/actions/lint
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: Lint
run: make lint
client:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v3.0.0
with:
project: client
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: build client
uses: ./.github/actions/build
with:
Expand All @@ -55,19 +70,15 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./service/node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('./service/yarn.lock') }}
- name: lint service
uses: ./.github/actions/lint
with:
project: service
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: build service
uses: ./.github/actions/build
with:
Expand All @@ -84,7 +95,7 @@ jobs:
service/artifacts/build
docker-cache
release-dry-run:
if: (github.ref != 'refs/heads/master') && (!contains(github.event.head_commit.message, 'skip ci'))
if: (github.ref != 'refs/heads/master') && (github.ref != 'refs/heads/next') && (!contains(github.event.head_commit.message, 'skip ci'))
needs: [service, client]
runs-on: ubuntu-latest
steps:
Expand All @@ -102,7 +113,7 @@ jobs:
- name: Load Docker Container
run: docker load < service/artifacts/build/docker-cache/sanity-service-docker.tar
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
Expand All @@ -121,9 +132,68 @@ jobs:
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.TOPHAT_BOT_GH_TOKEN }}
prerelease:
if: github.ref == 'refs/heads/next' && (!contains(github.event.head_commit.message, 'skip ci'))
needs: [static-analysis, service, client]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.TOPHAT_BOT_GH_TOKEN }}
- uses: actions/download-artifact@v2
with:
name: service-artifacts
path: service/artifacts/build
- uses: actions/download-artifact@v2
with:
name: client-artifacts
path: client/bin
- name: Load Docker Container
run: docker load < client/bin/docker-cache/sanity-docker-client.tar
- name: Load Docker Container
run: docker load < service/artifacts/build/docker-cache/sanity-service-docker.tar
- name: Setup Node.js
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: install dependencies
run: make install
- name: package artifacts
run: make create-release-package
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: run release dry run
run: |
make deploy-prerelease-dry
env:
GH_TOKEN: ${{ secrets.TOPHAT_BOT_GH_TOKEN }}
- name: Configure Git
run: |
git config --global user.name tophat-opensource-bot
git config --global user.email opensource-leads+bot@tophatmonocle.com
git config --global init.defaultBranch main
- name: run release
run: |
make deploy-prerelease
env:
GH_TOKEN: ${{ secrets.TOPHAT_BOT_GH_TOKEN }}
- name: Publish the service image to GHCR
run: make -C service publish-docker-prerelease
- name: Publish the client image to GHCR
run: make -C client publish-docker-prerelease
release:
if: (github.ref == 'refs/heads/master') && (!contains(github.event.head_commit.message, 'skip ci'))
needs: [service, client]
if: github.ref == 'refs/heads/master' && (!contains(github.event.head_commit.message, 'skip ci'))
needs: [static-analysis, service, client]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -142,7 +212,7 @@ jobs:
- name: Load Docker Container
run: docker load < service/artifacts/build/docker-cache/sanity-service-docker.tar
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
Expand All @@ -155,8 +225,7 @@ jobs:
run: make install
- name: package artifacts
run: make create-release-package
-
name: Login to GHCR
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
Expand Down Expand Up @@ -191,15 +260,15 @@ jobs:
persist-credentials: false
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: ./website/node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('./website/yarn.lock') }}
path: ./node_modules
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.19.0
lts/gallium
25 changes: 0 additions & 25 deletions .releaserc.js

This file was deleted.

9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

0 comments on commit 4633ab8

Please sign in to comment.