use GitHub actions for CI and automate Sonarcloud analysis
This commit is contained in:
44
.github/workflows/test.yml
vendored
Normal file
44
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: CI
|
||||||
|
on: push
|
||||||
|
jobs:
|
||||||
|
quality:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.0'
|
||||||
|
tools: composer
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
composer install --no-interaction
|
||||||
|
npm ci
|
||||||
|
- name: Code style checks for PHP, JS and CSS
|
||||||
|
run: |
|
||||||
|
composer lint-php
|
||||||
|
composer lint-js
|
||||||
|
composer lint-css
|
||||||
|
analysis:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Analyze with SonarCloud
|
||||||
|
uses: sonarsource/sonarcloud-github-action@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
with:
|
||||||
|
args: >
|
||||||
|
-Dsonar.organization=stklcode-github
|
||||||
|
-Dsonar.projectKey=stklcode:wp-liveticker
|
||||||
|
-Dsonar.sources=includes,scripts,views,stklcode-liveticker.php
|
||||||
|
-Dsonar.exclusions=scripts/*.min.js,styles/*.min.css
|
@ -8,8 +8,15 @@ jobs:
|
|||||||
name: Push to stable
|
name: Push to stable
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout
|
||||||
- uses: php-actions/composer@v5
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.0'
|
||||||
|
tools: composer
|
||||||
|
- name: Install
|
||||||
|
run: composer install --no-interaction
|
||||||
- name: Clean README.md
|
- name: Clean README.md
|
||||||
run: tail -n +7 README.md > README.md.tmp && mv README.md.tmp README.md
|
run: tail -n +7 README.md > README.md.tmp && mv README.md.tmp README.md
|
||||||
- name: WordPress.org plugin asset/readme update
|
- name: WordPress.org plugin asset/readme update
|
||||||
|
11
.github/workflows/wordpress-plugin-deploy.yml
vendored
11
.github/workflows/wordpress-plugin-deploy.yml
vendored
@ -9,8 +9,15 @@ jobs:
|
|||||||
name: New tag
|
name: New tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout
|
||||||
- uses: php-actions/composer@v5
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.0'
|
||||||
|
tools: composer
|
||||||
|
- name: Install
|
||||||
|
run: composer install --no-interaction
|
||||||
- name: Clean README.md
|
- name: Clean README.md
|
||||||
run: tail -n +7 README.md > README.md.tmp && mv README.md.tmp README.md
|
run: tail -n +7 README.md > README.md.tmp && mv README.md.tmp README.md
|
||||||
- name: WordPress Plugin Deploy
|
- name: WordPress Plugin Deploy
|
||||||
|
27
.travis.yml
27
.travis.yml
@ -1,27 +0,0 @@
|
|||||||
language: php
|
|
||||||
php:
|
|
||||||
- '7.3'
|
|
||||||
- '7.4'
|
|
||||||
- '8.0'
|
|
||||||
- nightly
|
|
||||||
dist: bionic
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
allow_failures:
|
|
||||||
- php: nightly
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- nvm install 14
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- composer install
|
|
||||||
- npm install
|
|
||||||
|
|
||||||
script:
|
|
||||||
- composer lint-php
|
|
||||||
- composer lint-js
|
|
||||||
- composer lint-css
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
slack:
|
|
||||||
secure: "R40BhRCETuDule7lz4oGN+qyLvd7dBmuEu6hVELNhWg3DgCgYOXyrWR2dgxsWsAZ3sldpWGfTJKzSShdDanGCpygpYzuvXxjt23YYJ2ihrohYJwiGIhkR9c24LF2yvWBQDBNZaeLBQ3o6FSnbkTBsmRy5ShgKehfKCOQTKmI1yWHi3fvkMElTorrJc710O41yy/bRKBnoIYd4ZfpLMSSVGCPzR5lZPZy3EiGWXPgYdY7jGMI7ADsy+T5VWHyFqgSSJz/U2bcryKzF08FAry8pyu9lN3r61kXHfVCCJX+kcsFxW9yCfuPLnLu14O776y3U6zrX9is+8mEfkMuTXFaL5o8+iq32AmFjTIDQn6o9BKHsknfmppjwZiLgFTp1T7Z/XR6I4nyK9Z5HXDU2HS0eCUknbgXlMLhxWpKhkyx4rQELuvVlgD+u7yRYraawc3v1ycqaPj0S0G5QBFljSuxsZgNnX1hs8VmgafIvOq5qm4ZVVBhhbz+LgvW1m9COr8DDPVhWWdpcWzF8jtkqC3m4Q/1Ssc6T/MbJMgcXRq/C4DlfEs4aYGYfSl7gLtF2PwlEQCppKJwx0fEPkcbZZ1PjpzF+JMwwRmWS88R0oRyThOyCwlG50c+ktB94pJC+sP1aQZrLAd4WDKUPD9vJTas86V3XBjTUJPs8HQaBDFqFdg="
|
|
@ -1,4 +1,4 @@
|
|||||||
[](https://travis-ci.com/stklcode/wp-liveticker)
|
[](https://github.com/stklcode/wp-liveticker/actions/workflows/test.yml)
|
||||||
[](https://sonarcloud.io/dashboard?id=stklcode%3Awp-liveticker)
|
[](https://sonarcloud.io/dashboard?id=stklcode%3Awp-liveticker)
|
||||||
[](https://wordpress.org/plugins/stklcode-liveticker/)
|
[](https://wordpress.org/plugins/stklcode-liveticker/)
|
||||||
[](https://packagist.org/packages/stklcode/stklcode-liveticker)
|
[](https://packagist.org/packages/stklcode/stklcode-liveticker)
|
||||||
|
Reference in New Issue
Block a user