Skip to content

Commit

Permalink
GithubActions: Add Qodana
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov committed Dec 15, 2020
1 parent 298962f commit e941aca
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 10 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/checkLinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: composer install
- name: Composer Install
run: composer install --ignore-platform-reqs

- name: build docker container
- name: Build Docker Container
run: docker-compose -f docker-compose.yml build >/dev/null

- name: run tests
- name: Run Tests
run: docker-compose -f docker-compose.yml run -e CHECK_LINKS=true php /opt/project/phpstorm-stubs/vendor/bin/phpunit /opt/project/phpstorm-stubs/tests/

- name: test stubs map
- name: Test Stubs Map
run: ./tests/check-stub-map
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: composer install
- name: Composer Install
run: composer install --ignore-platform-reqs

- name: build docker container
- name: Build Docker Container
run: docker-compose -f docker-compose.yml build >/dev/null

- name: run tests
- name: Run Tests
run: docker-compose -f docker-compose.yml run php /opt/project/phpstorm-stubs/vendor/bin/phpunit /opt/project/phpstorm-stubs/tests/

- name: test stubs map
- name: Test Stubs Map
run: ./tests/check-stub-map

#- name: run cs fixer
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Qodana - Code Inspection

on: [push, pull_request, workflow_dispatch]

jobs:
code_inspection:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

# Runs Qodana
- name: Qodana - Code Inspection
timeout-minutes: 600
run: docker run -v ${GITHUB_WORKSPACE}:/data/project -v ${GITHUB_WORKSPACE}/qodana:/data/results jetbrains/qodana:2020.3-eap --save-report

# Archives Qodana results to workflow artifacts
- name: Archive results
uses: actions/upload-artifact@v2
with:
name: qodana-results
if-no-files-found: error
path: qodana/report/results

# Prints Qodana results
- name: Print results
run: |
echo "🎉 Qodana has finished successfully!"
echo "Download an artifact qodana-results.zip. Code Inspection results are part of file result-allProblems.json."
echo "________________________________________________________________"
cat ${GITHUB_WORKSPACE}/qodana/report/results/result-allProblems.json
# Archives Qodana error logs if Qodana fails
- name: Archive error logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: qodana-error-logs
path: qodana

# Prints error message
- name: Print error message
if: failure()
run: |
echo "❌ Qodana has failed"
echo "Please contact our support team by email at [email protected]. Attach qodana-error-logs.zip to your message."

0 comments on commit e941aca

Please sign in to comment.