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

Standalone SonarQube plugin #14

Merged
merged 22 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 20 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
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
utarwyn marked this conversation as resolved.
Show resolved Hide resolved
name: Bug report
about: Report a way in which ecoCode-javascript is not working as intended
title: ''
labels: '💉 bug: unconfirmed'
assignees: ''

---

### Describe the bug

A clear and concise description of what the bug is.

### To Reproduce

Steps to reproduce the behavior:

1. ...
2. ...

### Expected behavior

A clear and concise description of what you expected to happen.

### Versions

> Please ensure you are running up to date software before making a bug report. Deprecated versions will not receive
> support.

- ecoCode-javascript version:
- SonarQube version (if applicable):

### Screenshots

If applicable, add screenshots to help explain your problem.

### Additional context

Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
utarwyn marked this conversation as resolved.
Show resolved Hide resolved
name: Feature request
about: Suggest an idea for ecoCode-javascript
title: ''
labels: '🚀 enhancement'
assignees: ''

---

### Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

### Describe the solution you'd like

A clear and concise description of what you want to happen.

### Additional context

Add any other context or screenshots about the feature request here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
utarwyn marked this conversation as resolved.
Show resolved Hide resolved
name: Question
about: You need information about something on the plugin
title: ''
labels: '❔ question'
assignees: ''

---

Ask your question in this textfield. Please be as precise as possible. Duplicate questions will not be answered.
36 changes: 22 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,44 @@ jobs:
strategy:
matrix:
node-version: [ 16.x, 18.x ]
java-version: [ 11 ]
utarwyn marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Use JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java-version }}

- name: Install dependencies
run: yarn install --immutable
- name: Lint
working-directory: eslint-plugin

- name: Lint eslint-plugin
run: yarn lint
- name: Test
working-directory: eslint-plugin

- name: Test eslint-plugin
run: yarn test:cov
working-directory: eslint-plugin

sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
- name: Verify SonarQube plugin
run: mvn -e -B verify
working-directory: sonar-plugin

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: yarn install --immutable
- name: Test
run: yarn test:cov
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.node-version == '18.x'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
24 changes: 0 additions & 24 deletions .github/workflows/check_version.yml

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish
utarwyn marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

permissions:
packages: write

env:
NODE_VERSION: 18.x

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout tag "${{ github.ref_name }}"
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --immutable
working-directory: eslint-plugin

- name: Copy LICENSE
run: cp LICENSE.md eslint-plugin/

- name: Publish package on NPM
run: npm publish --access public
working-directory: eslint-plugin
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-github:
runs-on: ubuntu-latest
steps:
- name: Checkout tag "${{ github.ref_name }}"
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: yarn install --immutable
working-directory: eslint-plugin

- name: Copy LICENSE
run: cp LICENSE.md eslint-plugin/

- name: Add scope to package name
run: npx --yes change-package-name @${{ github.repository_owner }}/ecocode-eslint-plugin
working-directory: eslint-plugin

- name: Configure GitHub Packages registry
uses: bduff9/use-npmrc@v2.0.0
with:
working-directory: eslint-plugin
dot-npmrc: |
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
@${{ github.repository_owner }}:registry=https://npm.pkg.github.com
always-auth=true

- name: Publish package on GitHub Packages
run: npm publish
working-directory: eslint-plugin
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading