Skip to content

Commit

Permalink
perf: up some deps, update linter config
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jul 14, 2023
1 parent 38ea6f1 commit 448bbc7
Show file tree
Hide file tree
Showing 14 changed files with 1,633 additions and 1,308 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'sonarjs/no-duplicate-string': 'off',
'no-template-curly-in-string': 'off',
'node/no-callback-literal': 'off'
'node/no-callback-literal': 'off',
'unicorn/consistent-destructuring': 'off'
}
};
147 changes: 46 additions & 101 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,72 +1,37 @@
# This is a Github Workflow that runs tests on any push or pull request.
# If the tests pass and this is a push to the master branch it also runs Semantic Release.

# This is a Github Workflow that runs tests on any push or pull request.
# If the tests pass and this is a push to the master branch it also runs Semantic Release.
name: CI
on: [push, pull_request]
jobs:
init:
name: init
runs-on: ubuntu-20.04
outputs:
skip: ${{ steps.ci-skip-step.outputs.ci-skip }}
skip-not: ${{ steps.ci-skip-step.outputs.ci-skip-not }}
steps:
- uses: actions/checkout@v3
- id: ci-skip-step
uses: mstachniuk/ci-skip@v1

build:
name: build
needs: init
if: ${{ needs.init.outputs.skip == 'false' }}
runs-on: ubuntu-20.04
push:
name: Push ${{ github.ref }}
if: github.event_name == 'push'
runs-on: ubuntu-22.04
permissions:
checks: read
statuses: write
contents: write
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: ${{ github.ref == 'refs/heads/master' && '0' || '1' }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
# cache: 'yarn'

- name: Fetch deps
run: yarn
run: yarn --mutex network --frozen-lockfile --network-concurrency 25 --silent --disable-self-update-check

- name: Build target
- name: Build
run: yarn build

- name: Save artifact
uses: actions/upload-artifact@v3
with:
name: artifact-${{ github.run_id }}
retention-days: 1
path: |
docs
target
flow-typed
typings
buildstamp.json
package.json
test_push:
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Restore artifact
uses: actions/download-artifact@v3
with:
name: artifact-${{ github.run_id }}

- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn
- name: Unit test only
- name: Run tests
run: yarn test

- name: Codeclimate
Expand All @@ -76,64 +41,44 @@ jobs:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/coverage/*.lcov:lcov
${{github.workspace}}/target/coverage/lcov.info:lcov
test_pr:
- name: Semantic Release
if: github.ref == 'refs/heads/master'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_PROVENANCE: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
run: npm_config_yes=true npx zx-semrel

pr:
if: github.event_name == 'pull_request'
needs: build
name: PR (Node v${{ matrix.node-version }}, OS ${{ matrix.os }})
strategy:
matrix:
os: [ ubuntu-20.04, windows-2019 ]
node-version: [ 14, 18 ]
name: Test (Node v${{ matrix.node-version }}, OS ${{ matrix.os }})
os: [ ubuntu-22.04, windows-latest ]
node-version: [ 16, 20 ]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Restore artifact
uses: actions/download-artifact@v3
with:
name: artifact-${{ github.run_id }}
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- name: Test only
if: matrix.node-version != '18' || matrix.os != 'ubuntu-20.04'
run: yarn test
# cache: 'yarn'

- name: Test & push coverage
if: matrix.node-version == '18' && matrix.os == 'ubuntu-20.04'
run: yarn test

release:
name: Release
# https://github.community/t/trigger-job-on-tag-push-only/18076
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: test_push
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Restore artifact
uses: actions/download-artifact@v3
with:
name: artifact-${{ github.run_id }}
- name: Fetch deps
run: yarn --mutex network --frozen-lockfile --network-concurrency 25 --silent --disable-self-update-check

- uses: actions/setup-node@v3
with:
node-version: 18
- name: Build
run: yarn build

- name: Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_USER: 'qiwibot'
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_EMAIL: '[email protected]'
GIT_AUTHOR_NAME: '@qiwibot'
GIT_COMMITTER_NAME: '@qiwibot'
run: npx -p @qiwi/semrel-toolkit semantic-release -e @qiwi/semrel-config
- name: Run tests
run: yarn test
161 changes: 136 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,54 +1,165 @@
# IDEs
.idea

# Credentials
**/*.asc
**/*.key
**/*.pem
**/*.cert
**/.npmrc
**/.yarnrc

# Bundles
bundle
build
buildstamp.json
dist
docs
flow-typed
lib
target
typings

# Temp assets
.temp
temp

# Codeclimate
codeclimate.*
cc-reporter
cc-reporter.*

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage
flow-coverage
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
coverage.*
*.lcov

# nyc test coverage
.nyc_output

# Bundle
build
dist
bundle
lib
target
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Docs
docs
doc
# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Deps
# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
.tsbuildinfo
buildcache
.buildcache

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

.idea
*.iml
typings
flow-typed
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Typescript
*.tsbuildinfo
.tsbuildinfo
buildcache
.buildcache
.rts2_cache_cjs
.rts2_cache_es
.rts2_cache_umd
# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

src/test/temp
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
Loading

0 comments on commit 448bbc7

Please sign in to comment.