-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ci: use GitHub workflows #41448
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
Merged
Merged
ci: use GitHub workflows #41448
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e8b08da
ci: use GitHub workflows
DeepDiver1975 0ac92e8
fix: Commitsar step
DeepDiver1975 7ca51af
fix: always run all jobs
DeepDiver1975 d1fc5f5
fix: simplify
DeepDiver1975 0a3ff4e
fix: split code tool into own steps
DeepDiver1975 96d95ab
fix: install server
DeepDiver1975 59da43f
chore: drop commitsar from droneci
DeepDiver1975 1fa9e3f
fix: drop php code tools from drone
DeepDiver1975 5e6b09b
fix: use commitsar from docker
DeepDiver1975 2345fb5
fix: drone.star
DeepDiver1975 9841010
fix: remove cache + fetch-depth
DeepDiver1975 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,237 @@ | ||
| name: Lint and Code Style | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| concurrency: | ||
| group: lint-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lint-php-codestyle: | ||
| name: PHP Code Style | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: ["7.4"] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check if changes affect PHP | ||
| id: changes | ||
| uses: dorny/paths-filter@v2 | ||
| with: | ||
| filters: | | ||
| php: | ||
| - '**/*.php' | ||
| - '!tests/acceptance/**' | ||
| - '!build/**' | ||
|
|
||
| - name: Setup PHP | ||
| if: steps.changes.outputs.php == 'true' | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| extensions: curl, gd, json, xml, zip | ||
| ini-values: "memory_limit=1024M" | ||
| tools: phpstan, codesniffer | ||
|
|
||
| - name: Cache Composer dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: vendor/ | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-composer- | ||
|
|
||
| - name: Install Composer dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: | | ||
| composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader | ||
|
|
||
| - name: Install vendor-bin dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: | | ||
| composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/owncloud-codestyle | ||
| composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan | ||
| composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan | ||
|
|
||
| - name: Run PHP Code Sniffer | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: make test-php-style | ||
| continue-on-error: true | ||
|
|
||
| phpstan-analysis: | ||
|
||
| name: PHPStan Static Analysis | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: ["7.4"] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check if changes affect PHP | ||
| id: changes | ||
| uses: dorny/paths-filter@v2 | ||
| with: | ||
| filters: | | ||
| php: | ||
| - '**/*.php' | ||
| - '!tests/acceptance/**' | ||
| - '!build/**' | ||
|
|
||
| - name: Setup PHP | ||
| if: steps.changes.outputs.php == 'true' | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| extensions: curl, gd, json, xml, zip | ||
| ini-values: "memory_limit=1024M" | ||
|
|
||
| - name: Cache Composer dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: vendor/ | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-composer- | ||
|
|
||
| - name: Install Composer dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader | ||
|
|
||
| - name: Install vendor-bin dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan | ||
|
|
||
| - name: Install server dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: make install-server | ||
|
|
||
| - name: Run PHPStan | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: make test-php-phpstan | ||
| continue-on-error: true | ||
|
|
||
| phan-analysis: | ||
|
||
| name: Phan Static Analysis | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: ["7.4"] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check if changes affect PHP | ||
| id: changes | ||
| uses: dorny/paths-filter@v2 | ||
| with: | ||
| filters: | | ||
| php: | ||
| - '**/*.php' | ||
| - '!tests/acceptance/**' | ||
| - '!build/**' | ||
|
|
||
| - name: Setup PHP | ||
| if: steps.changes.outputs.php == 'true' | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| extensions: curl, gd, json, xml, zip | ||
| ini-values: "memory_limit=1024M" | ||
|
|
||
| - name: Cache Composer dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: vendor/ | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-composer- | ||
|
|
||
| - name: Install Composer dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader | ||
|
|
||
| - name: Install vendor-bin dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan | ||
|
|
||
| - name: Install server dependencies | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: make install-server | ||
|
|
||
| - name: Run Phan | ||
| if: steps.changes.outputs.php == 'true' | ||
| run: make test-php-phan | ||
| continue-on-error: true | ||
|
|
||
| javascript-lint: | ||
|
||
| name: JavaScript Linting | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check if changes affect JavaScript | ||
| id: changes | ||
| uses: dorny/paths-filter@v2 | ||
| with: | ||
| filters: | | ||
| javascript: | ||
| - '**/*.js' | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
|
|
||
| - name: Setup Node.js | ||
| if: steps.changes.outputs.javascript == 'true' | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: "14" | ||
| cache: npm | ||
|
|
||
| - name: Install Node dependencies | ||
| if: steps.changes.outputs.javascript == 'true' | ||
| run: npm ci | ||
|
|
||
| - name: Run JavaScript linting | ||
| if: steps.changes.outputs.javascript == 'true' | ||
| run: npm run lint | ||
| continue-on-error: true | ||
|
|
||
| git-commit-messages: | ||
|
||
| name: Git Commit Messages | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'pull_request' | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Validate commit messages | ||
| uses: aevea/commitsar@v1.0.2 | ||
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/actions/checkout/releases is currently at major version 6.
But v4 is working fine, and we can easily bump it later.