Skip to content

Commit

Permalink
Merge branch 'ava'
Browse files Browse the repository at this point in the history
  • Loading branch information
screendriver committed Jul 15, 2023
2 parents 5a9fb05 + f4f5df9 commit c3f7f79
Show file tree
Hide file tree
Showing 13 changed files with 7,903 additions and 9,001 deletions.
8 changes: 5 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:testing-library/react",
"plugin:react-hooks/recommended"
"plugin:react-hooks/recommended",
"plugin:ava/recommended"
],
"plugins": ["@typescript-eslint", "react", "testing-library"],
"plugins": ["@typescript-eslint", "react", "testing-library", "ava"],
"env": {
"node": true
},
Expand All @@ -32,6 +33,7 @@
"@typescript-eslint/no-implicit-any-catch": "error",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off"
"react/prop-types": "off",
"ava/no-ignored-test-files": "off"
}
}
166 changes: 82 additions & 84 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,85 @@ name: CI
on: [push, pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
code-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- name: Setup timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Europe/Berlin
- name: Run unit tests
run: npm run test:unit:coverage
env:
FORCE_COLOR: 1
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: target/coverage/coverage-final.json
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16, 18]
steps:
- uses: actions/checkout@v3
- name: Use Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Check source code
run: |
npm run lint
npm run copy:paste:detection
- name: Compile source code
run: npm run compile
- name: Upload compiled source code as artifact
uses: actions/upload-artifact@v3
with:
name: compiled-source-node-${{ matrix.node-version }}
path: target/src/
- name: Setup timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Europe/Berlin
- name: Run integration tests
run: npm run test:integration
env:
FORCE_COLOR: 1
- name: Run mutation tests
run: npm run test:unit:mutation
release:
if: github.ref == 'refs/heads/main'
needs: [commitlint, code-coverage, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm ci
- name: Download compiled source code artifact
uses: actions/download-artifact@v3
with:
name: compiled-source-node-18
path: target/src/
- name: Semantic release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
code-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- name: Setup timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Europe/Berlin
- name: Run unit tests
run: npm run test:unit:coverage
env:
FORCE_COLOR: 1
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: target/coverage/coverage-final.json
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16, 18]
steps:
- uses: actions/checkout@v3
- name: Use Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Check source code
run: |
npm run lint
npm run copy:paste:detection
- name: Compile source code
run: npm run compile
- name: Upload compiled source code as artifact
uses: actions/upload-artifact@v3
with:
name: compiled-source-node-${{ matrix.node-version }}
path: target/src/
- name: Setup timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Europe/Berlin
- name: Run integration tests
run: npm run test:integration
env:
FORCE_COLOR: 1
release:
if: github.ref == 'refs/heads/main'
needs: [commitlint, code-coverage, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm ci
- name: Download compiled source code artifact
uses: actions/download-artifact@v3
with:
name: compiled-source-node-18
path: target/src/
- name: Semantic release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions ava.config.integration.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import defaultConfig from './ava.config.mjs';

export default {
...defaultConfig,
files: ['./test/integration/**/*.test.{ts,tsx}'],
};
5 changes: 5 additions & 0 deletions ava.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
files: ['./test/unit/**/*.test.{ts,tsx}'],
extensions: ['ts', 'tsx'],
require: ['ts-node/register/transpile-only'],
};
Loading

0 comments on commit c3f7f79

Please sign in to comment.