Skip to content

Commit

Permalink
ci: add golangci-lint check
Browse files Browse the repository at this point in the history
Signed-off-by: Loic Devulder <[email protected]>
  • Loading branch information
ldevulder committed Jul 24, 2023
1 parent b3c995c commit 71b8126
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Lint

on:
pull_request:
push:
branches:
- main
tags:
- 'v*'

jobs:
golang-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version-file: tests/go.mod
- name: Analysis
uses: golangci/golangci-lint-action@v3
with:
args: -v
working-directory: tests
cypress-lint:
runs-on: ubuntu-latest
env:
NODE_VERSION: current
WORKING_DIR: tests/cypress/latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install npm
run: |
cd ${{ env.WORKING_DIR }}
#npm install --save-dev eslint-plugin-cypress @typescript-eslint/parser @typescript-eslint/eslint-plugin
npm install --save-dev
npm ls --depth=0
- name: Analysis
uses: sibiraj-s/action-eslint@v3
with:
extensions: 'js,ts'
working-directory: ${{ env.WORKING_DIR }}
12 changes: 12 additions & 0 deletions tests/cypress/latest/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:cypress/recommended"
],
"parser": "vue-eslint-parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
}
}
9 changes: 8 additions & 1 deletion tests/cypress/latest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@
"dotenv": "^10.0.0",
"@rancher-ecp-qa/cypress-library": "1.0.4",
"typescript": "^4.5.2"
},
"devDependencies": {
"@typescript-eslint/parser": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/no-var-requires": "latest",
"eslint-plugin-cypress": "latest",
"vue-eslint-parser": "latest"
}
}
}

0 comments on commit 71b8126

Please sign in to comment.