Skip to content

Commit

Permalink
fixing linting (#297)
Browse files Browse the repository at this point in the history
* simplified github lint action. fixing cypres?

* lint

* simplifying vitest action
  • Loading branch information
ermish authored Dec 5, 2023
1 parent b3b6847 commit 3d66bd1
Show file tree
Hide file tree
Showing 10 changed files with 296 additions and 112 deletions.
95 changes: 15 additions & 80 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,36 @@ on:
branches: [ "main" ]
schedule:
- cron: '45 15 * * 4'
env:
CACHE_PATH: ./*
CACHE_KEY: lint-cache-${{ github.sha }}
permissions:
contents: read
security-events: write
actions: write # This is needed for pull requests to delete
actions: write # This is needed for pull requests to delete

jobs:
setup:

name: Setup 🛫
# ESLint is a tool for identifying and reporting on patterns
# found in ECMAScript/JavaScript code.
# More details at https://github.com/eslint/eslint
# and https://eslint.org
eslint:
name: ESLint ✨
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
runs-on: ubuntu-latest
node-version: [21.3.0]
steps:
- name: Setup Cache
uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}-${{ matrix.node-version }}
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Yarn/ Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install Dependencies
run: yarn install --immutable
# this is needed to generate things like tsconfig declerations
- name: Prepare Nuxt
run: yarn prepare:ci
teardown:
name: Teardown 🛬
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
needs:
# list of lint jobs
- eslint
if: always()
env:
LINT_RESULTS: ${{ toJson(needs) }}
steps:
- name: Run ESLint
run: yarn lint:ci
- name: Check Lint Status
if: always()
run: |
Expand All @@ -66,51 +47,5 @@ jobs:
exit 1
fi
exit 0
# ESLint is a tool for identifying and reporting on patterns
# found in ECMAScript/JavaScript code.
# More details at https://github.com/eslint/eslint
# and https://eslint.org
eslint:
name: ESLint ✨
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
node-version: [18]
steps:
- name: Load Cache
uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}-${{ matrix.node-version }}
- name: Run ESLint
run: yarn lint:ci

- name: Upload Results
uses: github/codeql-action/upload-sarif@v2
if: always() # upload even if the lint fails
with:
sarif_file: eslint-results.sarif
wait-for-processing: true

# Stylelint is a tool for identifying and reporting on patterns
# found in CSS code.
# More details at https://stylelint.io/
stylelint:
name: Stylelint ✨
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
node-version: [18]
steps:
- name: Load Cache
uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}-${{ matrix.node-version }}
- name: Run Styelint
run: yarn lint:css
env:
LINT_RESULTS: ${{ toJson(needs) }}
34 changes: 5 additions & 29 deletions .github/workflows/vitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,21 @@ name: "Tests: vitest"

on:
push:
branches: ["main", "ragezbla/89-vitest-gh-actions"] # TODO remove after checking it works
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
schedule:
- cron: "45 15 * * 4"
env:
CACHE_PATH: ./*
CACHE_KEY: vitest-cache-${{ github.sha }}

jobs:
setup:
name: Setup 🛫
name: Running Pinia Tests 🚀
strategy:
matrix:
node-version: [16, 18]
node-version: [21.3.0]
runs-on: ubuntu-latest
steps:
- name: Setup Cache
uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}-${{ matrix.node-version }}
- name: Checkout Code
uses: actions/checkout@v3
with:
Expand All @@ -36,22 +28,6 @@ jobs:
cache: "yarn"
- name: Install Dependencies
run: yarn install --immutable
# this is needed to generate things like tsconfig declerations
- name: Prepare Nuxt
run: yarn prepare:ci

run-pinia-tests:
runs-on: ubuntu-latest
name: Running Pinia Tests 🚀
needs: setup
strategy:
matrix:
node-version: [16, 18]
steps:
- name: Load Cache
uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}-${{ matrix.node-version }}
- name: Run Vitest
# Run the tests!
- name: Run Vitest 🚀
run: yarn run test:pinia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2018",
"target": "ESNext",
"module": "ESNext",
"lib": [
"ESNext",
Expand All @@ -10,7 +10,8 @@
"types": [
"cypress",
"node"
]
],
"sourceMap": false
},
"include": ["**/*.ts"]
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@nuxt/types": "^2.17.2",
"@nuxtjs/i18n": "next",
"@swc/core": "^1.3.100",
"@testing-library/vue": "^6.6.1",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitejs/plugin-vue": "^4.5.1",
"@vitest/coverage-v8": "^1.0.1",
"@vue/test-utils": "^2.2.6",
"all-contributors-cli": "^6.24.0",
"autoprefixer": "^10.4.16",
Expand Down
Loading

0 comments on commit 3d66bd1

Please sign in to comment.