name: Lint on: [ push, pull_request ] jobs: lint: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Install node dependencies run: cd src/client && yarn install - name: Lint client code run: cd src/client && yarn lint - name: Lint installer client code run: | cd installer/client yarn install yarn lint - name: Lint Cypress tests run: cd src/test/functional && yarn install && yarn lint - name: Install dependencies run: | php8.1 -f /usr/bin/composer install -d src php8.1 -f /usr/bin/composer install -d devTools/core - name: Check PHP Coding Standards run: php devTools/core/console.php php-cs-fix --php php8.1 - name: Check files changed id: git-status run: | git status --porcelain echo "status=$(git status --porcelain)" >> $GITHUB_OUTPUT - name: Fail if files changed if: ${{ steps.git-status.outputs.status }} uses: actions/github-script@v4 with: script: | core.setFailed('Files changed with lint fix') - name: Creating diff if: ${{ failure() }} run: | git status git diff > ${{ github.sha }}.diff - name: Generate API doc run: php devTools/core/console.php generate-open-api-doc --throw - name: Upload Artifacts uses: actions/upload-artifact@v4 if: ${{ failure() }} with: name: diff-${{ github.sha }} path: ${{ github.sha }}.diff - name: Upload API doc uses: actions/upload-artifact@v4 with: name: API-doc-${{ github.sha }} path: | build/index.html build/orangehrm-v2.json