ci: scan the distribution tree for known vulnerabilities (#41778) #980
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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| semantic-git-messages: | |
| name: Commits | |
| uses: owncloud/reusable-workflows/.github/workflows/semantic-git-message.yml@main | |
| js-unit: | |
| name: JavaScript Unit | |
| uses: ./.github/workflows/js-unit.yml | |
| php-unit: | |
| name: PHP Unit | |
| uses: ./.github/workflows/php-unit.yml | |
| with: | |
| php-versions: '["8.3"]' | |
| calens: | |
| name: Changelog lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Validate changelog entries | |
| uses: actionhippie/calens@2008d3a7a90cf05a2a001a3d47cac06cb1b74617 # v1.14.2 | |
| acceptance-api-smoke: | |
| if: ${{ !contains(github.event.pull_request.title, 'full-ci') }} | |
| name: API Smoke Tests | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-api-tests: true | |
| server-folder: 'server' | |
| federated-folder: 'federated' | |
| additional-app: 'notifications' | |
| additional-packages: 'imagemagick' | |
| filter-tags: '@smokeTest' | |
| test-suites: "[ | |
| 'apiAuth,apiAuthOcs,apiAuthWebDav,apiCapabilities,apiComments,apiFavorites,apiFederationToRoot1,apiFederationToRoot2,apiFederationToShares1,apiFederationToShares2,apiMain', | |
| 'apiProvisioning-v1,apiProvisioning-v2,apiProvisioningGroups-v1,apiProvisioningGroups-v2,apiShareCreateSpecialToRoot1,apiShareCreateSpecialToRoot2,apiShareCreateSpecialToShares1,apiShareCreateSpecialToShares2,apiSharees,apiShareManagementBasicToRoot,apiShareManagementBasicToShares', | |
| 'apiShareManagementToRoot,apiShareManagementToShares,apiShareOperationsToRoot1,apiShareOperationsToRoot2,apiShareOperationsToShares1,apiShareOperationsToShares2,apiSharePublicLink1,apiSharePublicLink2,apiSharePublicLink3,apiShareReshareToRoot1,apiShareReshareToRoot2,apiShareReshareToRoot3', | |
| 'apiShareReshareToShares1,apiShareReshareToShares2,apiShareReshareToShares3,apiShareUpdateToRoot,apiShareUpdateToShares,apiSharingNotificationsToRoot,apiSharingNotificationsToShares,apiTags,apiTranslation,apiTrashbin,apiTrashbinRestore,apiVersions,apiWebdavDelete,apiWebdavEtagPropagation1,apiWebdavEtagPropagation2,apiWebdavLocks', | |
| 'apiWebdavLocks2,apiWebdavLocks3,apiWebdavLocksUnlock,apiWebdavMove1,apiWebdavMove2,apiWebdavOperations,apiWebdavPreviews,apiWebdavProperties1,apiWebdavProperties2,apiWebdavUpload1,apiWebdavUpload2']" | |
| acceptance-api: | |
| if: contains(github.event.pull_request.title, 'full-ci') | |
| name: API Tests | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-api-tests: true | |
| server-folder: 'server' | |
| test-suites: "[ | |
| 'apiAuth,apiAuthOcs,apiAuthWebDav', | |
| 'apiCapabilities,apiComments,apiFavorites,apiMain', | |
| 'apiProvisioning-v1,apiProvisioning-v2', | |
| 'apiProvisioningGroups-v1,apiProvisioningGroups-v2', | |
| 'apiShareCreateSpecialToRoot1,apiShareCreateSpecialToRoot2', | |
| 'apiShareCreateSpecialToShares1,apiShareCreateSpecialToShares2', | |
| 'apiSharees,apiWebdavOperations', | |
| 'apiShareManagementBasicToRoot,apiShareManagementBasicToShares', | |
| 'apiShareManagementToRoot,apiShareManagementToShares', | |
| 'apiShareOperationsToRoot1,apiShareOperationsToRoot2', | |
| 'apiShareOperationsToShares1,apiShareOperationsToShares2', | |
| 'apiSharePublicLink1,apiSharePublicLink2,apiSharePublicLink3', | |
| 'apiShareReshareToRoot1,apiShareReshareToRoot2,apiShareReshareToRoot3', | |
| 'apiShareReshareToShares1,apiShareReshareToShares2,apiShareReshareToShares3', | |
| 'apiShareUpdateToRoot,apiShareUpdateToShares,apiTags,apiTranslation', | |
| 'apiTrashbin,apiTrashbinRestore', | |
| 'apiVersions,apiWebdavDelete', | |
| 'apiWebdavEtagPropagation1,apiWebdavEtagPropagation2', | |
| 'apiWebdavLocks,apiWebdavLocks2', | |
| 'apiWebdavLocks3,apiWebdavLocksUnlock', | |
| 'apiWebdavMove1,apiWebdavMove2', | |
| 'apiWebdavProperties1,apiWebdavProperties2', | |
| 'apiWebdavUpload1,apiWebdavUpload2']" | |
| acceptance-api-notifications: | |
| if: contains(github.event.pull_request.title, 'full-ci') | |
| name: API Tests Notifications | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-api-tests: true | |
| server-folder: 'server' | |
| additional-app: 'notifications' | |
| test-suites: "['apiSharingNotificationsToRoot,apiSharingNotificationsToShares']" | |
| acceptance-api-previews: | |
| if: contains(github.event.pull_request.title, 'full-ci') | |
| name: API Tests Previews | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-api-tests: true | |
| additional-packages: 'imagemagick' | |
| server-folder: 'server' | |
| test-suites: "['apiWebdavPreviews']" | |
| acceptance-api-federation: | |
| if: contains(github.event.pull_request.title, 'full-ci') | |
| name: API Tests Federation | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-api-tests: true | |
| server-folder: 'server' | |
| federated-folder: 'federated' | |
| test-suites: "['apiFederationToRoot1,apiFederationToRoot2', 'apiFederationToShares1,apiFederationToShares2']" | |
| acceptance-cli-smoke: | |
| if: ${{ !contains(github.event.pull_request.title, 'full-ci') }} | |
| name: CLI Smoke Tests | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-cli-tests: true | |
| use-email-server: true | |
| server-folder: 'server' | |
| filter-tags: '@smokeTest' | |
| acceptance-cli: | |
| if: contains(github.event.pull_request.title, 'full-ci') | |
| name: CLI Tests | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-cli-tests: true | |
| server-folder: 'server' | |
| test-suites: "['cliBackground,cliMain,cliManageApps,cliTrashbin']" | |
| acceptance-cli-email: | |
| if: contains(github.event.pull_request.title, 'full-ci') | |
| name: CLI Tests with Email | |
| needs: [semantic-git-messages, php-unit, calens] | |
| uses: ./.github/workflows/acceptance.yml | |
| with: | |
| do-cli-tests: true | |
| use-email-server: true | |
| server-folder: 'server' | |
| test-suites: "['cliProvisioning']" | |
| acceptance-api-pass: | |
| if: always() | |
| name: API Acceptance Tests | |
| needs: [acceptance-api, acceptance-api-federation, acceptance-api-notifications, acceptance-api-previews, acceptance-api-smoke] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check status of API Acceptance Tests | |
| env: | |
| API_RESULT: ${{ needs.acceptance-api.result }} | |
| API_FEDERATION_RESULT: ${{ needs.acceptance-api-federation.result }} | |
| API_NOTIFICATIONS_RESULT: ${{ needs.acceptance-api-notifications.result }} | |
| API_PREVIEWS_RESULT: ${{ needs.acceptance-api-previews.result }} | |
| API_SMOKE_RESULT: ${{ needs.acceptance-api-smoke.result }} | |
| run: | | |
| RETURN_STATUS=0 | |
| if [[ "${API_RESULT}" != "success" && "${API_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-api job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${API_FEDERATION_RESULT}" != "success" && "${API_FEDERATION_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-api-federation job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${API_NOTIFICATIONS_RESULT}" != "success" && "${API_NOTIFICATIONS_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-api-notifications job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${API_PREVIEWS_RESULT}" != "success" && "${API_PREVIEWS_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-api-previews job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${API_SMOKE_RESULT}" != "success" && "${API_SMOKE_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-api-smoke job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${API_RESULT}" == "skipped" && "${API_FEDERATION_RESULT}" == "skipped" && "${API_NOTIFICATIONS_RESULT}" == "skipped" && "${API_PREVIEWS_RESULT}" == "skipped" && "${API_SMOKE_RESULT}" == "skipped" ]]; then | |
| echo "All the API Acceptance jobs were skipped" | |
| RETURN_STATUS=1 | |
| fi | |
| exit ${RETURN_STATUS} | |
| acceptance-cli-pass: | |
| if: always() | |
| name: CLI Acceptance Tests | |
| needs: [acceptance-cli, acceptance-cli-email, acceptance-cli-smoke] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check status of CLI Acceptance Tests | |
| env: | |
| CLI_RESULT: ${{ needs.acceptance-cli.result }} | |
| CLI_EMAIL_RESULT: ${{ needs.acceptance-cli-email.result }} | |
| CLI_SMOKE_RESULT: ${{ needs.acceptance-cli-smoke.result }} | |
| run: | | |
| RETURN_STATUS=0 | |
| if [[ "${CLI_RESULT}" != "success" && "${CLI_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-cli job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${CLI_EMAIL_RESULT}" != "success" && "${CLI_EMAIL_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-cli-email job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${CLI_SMOKE_RESULT}" != "success" && "${CLI_SMOKE_RESULT}" != "skipped" ]]; then | |
| echo "The acceptance-cli-smoke job was not successful" | |
| RETURN_STATUS=1 | |
| fi | |
| if [[ "${CLI_RESULT}" == "skipped" && "${CLI_EMAIL_RESULT}" == "skipped" && "${CLI_SMOKE_RESULT}" == "skipped" ]]; then | |
| echo "All the CLI Acceptance jobs were skipped" | |
| RETURN_STATUS=1 | |
| fi | |
| exit ${RETURN_STATUS} |