Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: testing github actions #1

Closed
wants to merge 6 commits into from
Closed
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist/
.eslintrc.js
tsconfig.json
vite.config.ts
vitest.config.ts
env.d.ts
24 changes: 24 additions & 0 deletions .github/actions/provision/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Provision
description: Set up job with tasks needed to run a code check
runs:
using: 'composite'
steps:
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/cache@v3
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}

- uses: nick-fields/retry@v2
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
with:
timeout_minutes: 5
max_attempts: 3
command: yarn --frozen-lockfile
72 changes: 72 additions & 0 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Code Checks

on:
merge_group:
push:
branches:
- '**'

jobs:
lint-eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- name: Lint
run: yarn lint:eslint

lint-filename:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- name: File name checker
run: yarn lint:filename

lint-prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- name: Lint
run: yarn lint:prettier

lint-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Lint commit message
uses: wagoid/commitlint-github-action@v4

lint-unused-exports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- name: Lint unused TypeScript exports
run: yarn lint:unused-exports

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- name: Typecheck
run: yarn typecheck

test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- name: Test
run: yarn test:unit
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
branches: [ dev ]
pull_request:
branches: [ main, master ]
branches: [ dev ]
jobs:
test:
timeout-minutes: 60
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist/
.eslintrc.js
tsconfig.json
vite.config.ts
vitest.config.ts
env.d.ts
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint:prettier": "prettier --check \"{src,tests}/**/*.{ts,tsx}\" \"*.{js,json}\"",
"lint:prettier:fix": "prettier --write \"{src,tests}/**/*.{ts,tsx}\" *.js",
"lint:unused-exports": "ts-unused-exports tsconfig.json --ignoreFiles=tests",
"test:unit": "vitest",
"typecheck": "tsc --noEmit",
"test:unit": "vitest unit",
"test:integration": "npx playwright test",
"preview": "vite preview"
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/modals/components/modal-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function ModalContainer(): React.JSX.Element {

return (
<>
<SelectWalletModal
<SelectWalletModal
isOpen={isSelectWalletModalOpen}
handleClose={() =>
handleClosingModal(modalActions.toggleSelectWalletModalVisibility)
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
testMatch: ['**/tests/unit/**/*.[jt]s?(x)'],
});
Loading