Skip to content

Commit

Permalink
ci: add Golang and Cypress linter
Browse files Browse the repository at this point in the history
Signed-off-by: Loic Devulder <[email protected]>
  • Loading branch information
ldevulder committed Jul 25, 2023
1 parent 0881aa8 commit 882e8b5
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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
npm ls --depth=0
- name: Analysis
uses: sibiraj-s/action-eslint@v3
with:
extensions: 'js,ts'
working-directory: ${{ env.WORKING_DIR }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Elemental

[![Code style](https://github.com/rancher/elemental/actions/workflows/lint.yaml/badge.svg?branch=main)](https://github.com/rancher/elemental/actions/workflows/lint.yaml)

CI with latest stable Rancher Manager:

[![CLI-K3s-Rancher_Stable](https://github.com/rancher/elemental/actions/workflows/cli-k3s-rancher_stable.yaml/badge.svg?branch=main)](https://github.com/rancher/elemental/actions/workflows/cli-k3s-rancher_stable.yaml)
Expand Down
13 changes: 13 additions & 0 deletions tests/cypress/latest/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:cypress/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
}
}
7 changes: 6 additions & 1 deletion tests/cypress/latest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,10 @@
"dotenv": "^10.0.0",
"@rancher-ecp-qa/cypress-library": "1.0.6",
"typescript": "^4.5.2"
},
"devDependencies": {
"@typescript-eslint/parser": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"eslint-plugin-cypress": "latest"
}
}
}

0 comments on commit 882e8b5

Please sign in to comment.