Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #7 from mathrix-education/dev
Browse files Browse the repository at this point in the history
chore(release): release version 1.0.0
  • Loading branch information
matbour authored Jan 27, 2020
2 parents a0c47f9 + 0d01e52 commit f40ca3a
Show file tree
Hide file tree
Showing 15 changed files with 462 additions and 201 deletions.
6 changes: 1 addition & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
extends: ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint', 'plugin:prettier/recommended'],
env: {
node: true,
},
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [4.2.0.1873]
with-jre: ['false', 'true']
version: ['4.2.0.1873']
exclude:
- os: macos-latest
with-jre: 'false'
version: '4.2.0.1873'
- os: windows-latest
with-jre: 'false'
version: '4.2.0.1873'
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Extract context
if: matrix.os == 'ubuntu-latest'
id: context
Expand All @@ -39,7 +47,7 @@ jobs:
sonar.login=no token
INPUT_UNSHALLOW: ${{ matrix.os == 'ubuntu-latest' }}
INPUT_TYPESCRIPT: ${{ matrix.os == 'ubuntu-latest' }}
INPUT_SCAN: ${{ matrix.os == 'ubuntu-latest' }}
INPUT_SCAN: ${{ matrix.os == 'ubuntu-latest' && matrix.with-jre }}
INPUT_ARGS: >-
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.host.url=${{ secrets.SONAR_HOST }}
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
quoteProps: 'as-needed',
trailingComma: 'all',
arrowParens: 'avoid',
printWidth: 120,
};
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## Version 1.0.0
- **fixed**: installation if TypeScript will not install all node dependencies anymore
- **changed**: new install directories
- `/usr/lib/sonar-scanner-cli` on Ubuntu runners (overrides the already installed one)
- `$HOME/sonar-scanner-cli` on MacOS runners
- `C:\Program Files\sonar-scanner-cli` on Windows runners
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# @mathrix-education/sonar-scanner

![Workflow status][workflow]
![Latest release][latest-release]

[workflow]: https://img.shields.io/github/workflow/status/mathrix-education/sonar-scanner/Tests?style=flat-square
[latest-release]: https://img.shields.io/github/v/release/mathrix-education/sonar-scanner?label=latest%20release&style=flat-square

Install the Sonar Scanner CLI in GitHub Actions workflow.

This project is **not supported** by Sonar Cloud.
Expand Down Expand Up @@ -37,13 +44,26 @@ The supported operating systems matrix is the following:
### Inputs
See [action.yml](action.yml) for details.

| Name | Type | Default value |
|-----------------------|--------------------------------|---------------|
| `version` | `'latest'` / `string` | |
| `with-jre` | `true` / `false` | `false` |
| `options` | `string` | `''` |
| `typescript` | `true` / `false` | `false` |
| `unshallow` | `true` / `false` | `false` |
| `scan` | `true` / `false` | `false` |
| `args` | `string` | `''` |

#### version
The `version` is required since it is used to download Sonar Scanner.
You can find the available versions on the official Sonar Scanner
[repository][3.2]

[3.2]: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/

#### with-jre
Use the bundled JRE in the Sonar Scanner CLI archive.

#### options
The `options` input will set the default sonar-project.properties values
by writing into the `conf/sonar-project.properties` file.
Expand All @@ -62,7 +82,7 @@ Additional flags to append to the `sonar-scanner` command. It will be
ignored if `scan` is set to `false`.

### Examples
To analyse the repository, we would add the following code to our
To analyse this repository, we would add the following code to our
workflow:

```yaml
Expand All @@ -71,5 +91,5 @@ workflow:
version: 4.2.0.1873 # required
typescript: true
scan: true
args: --debug
args: --debug -Dsonar.login=${{ secrets.SONAR_TOKEN }}
```
16 changes: 10 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
version:
description: The Sonar Scanner version.
required: true
with-jre:
description: Use the bundled JRE.
required: false
default: 'false'
options:
description: Default Sonar Scanner options. Read as a YAML document (you may use the pipe '|' YAML operator).
required: false
Expand All @@ -19,15 +23,15 @@ inputs:
Install TypeScript during setup (simply run `npm i typescript`). Required if your project uses Typescript and if
the node module `typescript` is not already installed.
required: false
default: false
scan:
description: Run Sonar Scanner immediately in the current working directory.
required: false
default: false
default: 'false'
unshallow:
description: Fetch a full clone of the repository. Useful when using the SCM feature of Sonar Scanner.
required: false
default: false
default: 'false'
scan:
description: Run Sonar Scanner immediately in the current working directory.
required: false
default: 'false'
args:
description: Additionnal flag to append during the scan. Ignored if `scan` is false.
required: false
Loading

0 comments on commit f40ca3a

Please sign in to comment.