From f793f01480950c40b6de48d47568e621e42a5c14 Mon Sep 17 00:00:00 2001 From: James Wragg <5068769+jerotire@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:33:48 +0100 Subject: [PATCH] ci: remove remote repository checkout & cleanup .github in app/* (#248) * ci: removed repository env dependancy * ci: removed .github from app folders --- .github/workflows/php.yaml | 21 +---- app/api/.github/dependabot.yaml | 47 ----------- app/api/.github/workflows/cd.yaml | 24 ------ app/api/.github/workflows/ci.yaml | 23 ----- .../.github/workflows/static-analysis.yaml | 83 ------------------- app/internal/.github/dependabot.yaml | 47 ----------- app/internal/.github/workflows/cd.yaml | 24 ------ app/internal/.github/workflows/ci.yaml | 23 ----- .../.github/workflows/static-analysis.yaml | 83 ------------------- app/selfserve/.github/dependabot.yaml | 47 ----------- app/selfserve/.github/workflows/cd.yaml | 24 ------ app/selfserve/.github/workflows/ci.yaml | 23 ----- 12 files changed, 4 insertions(+), 465 deletions(-) delete mode 100644 app/api/.github/dependabot.yaml delete mode 100644 app/api/.github/workflows/cd.yaml delete mode 100644 app/api/.github/workflows/ci.yaml delete mode 100644 app/api/.github/workflows/static-analysis.yaml delete mode 100644 app/internal/.github/dependabot.yaml delete mode 100644 app/internal/.github/workflows/cd.yaml delete mode 100644 app/internal/.github/workflows/ci.yaml delete mode 100644 app/internal/.github/workflows/static-analysis.yaml delete mode 100644 app/selfserve/.github/dependabot.yaml delete mode 100644 app/selfserve/.github/workflows/cd.yaml delete mode 100644 app/selfserve/.github/workflows/ci.yaml diff --git a/.github/workflows/php.yaml b/.github/workflows/php.yaml index 92d0ed14bd..b0df415315 100644 --- a/.github/workflows/php.yaml +++ b/.github/workflows/php.yaml @@ -28,15 +28,11 @@ jobs: defaults: run: working-directory: app/${{ inputs.project }} - env: - # Temporary until this repository becomes a mono-repository: https://dvsa.atlassian.net/browse/VOL-4961. - REMOTE_REPOSITORY: ${{ inputs.project == 'api' && 'dvsa/olcs-backend' || format('dvsa/olcs-{0}', inputs.project) }} steps: - uses: actions/checkout@v4 with: - repository: ${{ env.REMOTE_REPOSITORY }} ref: ${{ inputs.ref || null }} - path: app/${{ inputs.project }} + sparse-checkout: app/${{ inputs.project }} fetch-depth: ${{ !inputs.ref && 1 || 0 }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -64,14 +60,11 @@ jobs: defaults: run: working-directory: app/${{ inputs.project }} - env: - # Temporary until this repository becomes a mono-repository. - REMOTE_REPOSITORY: ${{ inputs.project == 'api' && 'dvsa/olcs-backend' || format('dvsa/olcs-{0}', inputs.project) }} steps: - uses: actions/checkout@v4 with: - repository: ${{ env.REMOTE_REPOSITORY }} ref: ${{ inputs.ref || null }} + sparse-checkout: app/${{ inputs.project }} path: app/${{ inputs.project }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -116,14 +109,11 @@ jobs: # defaults: # run: # working-directory: app/${{ inputs.project }} - # env: - # # Temporary until this repository becomes a mono-repository: https://dvsa.atlassian.net/browse/VOL-4961. - # REMOTE_REPOSITORY: ${{ inputs.project == 'api' && 'dvsa/olcs-backend' || format('dvsa/olcs-{0}', inputs.project) }} # steps: # - uses: actions/checkout@v4 # with: - # repository: ${{ env.REMOTE_REPOSITORY }} # ref: ${{ inputs.ref || null }} + # sparse-checkout: app/${{ inputs.project }} # path: app/${{ inputs.project }} # - name: Setup PHP # uses: shivammathur/setup-php@v2 @@ -155,14 +145,11 @@ jobs: defaults: run: working-directory: app/${{ inputs.project }} - env: - # Temporary until this repository becomes a mono-repository: https://dvsa.atlassian.net/browse/VOL-4961. - REMOTE_REPOSITORY: ${{ inputs.project == 'api' && 'dvsa/olcs-backend' || format('dvsa/olcs-{0}', inputs.project) }} steps: - uses: actions/checkout@v4 with: - repository: ${{ env.REMOTE_REPOSITORY }} ref: ${{ inputs.ref || null }} + sparse-checkout: app/${{ inputs.project }} path: app/${{ inputs.project }} - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/app/api/.github/dependabot.yaml b/app/api/.github/dependabot.yaml deleted file mode 100644 index 9e92476443..0000000000 --- a/app/api/.github/dependabot.yaml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "composer" - directory: "/" - versioning-strategy: "increase-if-necessary" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/phpcs" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/phpstan" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/psalm" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - groups: - github-action-dependencies: - patterns: - - "*" diff --git a/app/api/.github/workflows/cd.yaml b/app/api/.github/workflows/cd.yaml deleted file mode 100644 index 321feacfcc..0000000000 --- a/app/api/.github/workflows/cd.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: CD - -on: - push: - branches: - - main - -jobs: - release-please: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - outputs: - tag_name: ${{ steps.release.outputs.tag_name }} - release_created: ${{ steps.release.outputs.release_created }} - sha: ${{ steps.release.outputs.sha }} - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: php - package-name: olcs-backend diff --git a/app/api/.github/workflows/ci.yaml b/app/api/.github/workflows/ci.yaml deleted file mode 100644 index c9f522e650..0000000000 --- a/app/api/.github/workflows/ci.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: CI - -on: - pull_request: - schedule: - - cron: '0 0 * * 1' - -jobs: - security: - uses: dvsa/.github/.github/workflows/php-security.yml@main - secrets: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - static-analysis: - uses: ./.github/workflows/static-analysis.yaml - with: - php-version: '8.2' - - tests: - uses: dvsa/.github/.github/workflows/php-tests.yml@main - with: - php-versions: '["8.2"]' - fail-fast: false diff --git a/app/api/.github/workflows/static-analysis.yaml b/app/api/.github/workflows/static-analysis.yaml deleted file mode 100644 index 38c83538be..0000000000 --- a/app/api/.github/workflows/static-analysis.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: Static analysis - -on: - workflow_call: - inputs: - php-version: - required: false - type: string - default: 'latest' - composer-version: - required: false - type: string - default: 'v2' - -jobs: - phpstan: - - name: PHPStan - ${{ inputs.php-version }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - coverage: none - tools: phpstan, composer:${{ inputs.composer-version }} - - - name: Install Composer dependancies - run: composer install --no-progress --no-interaction - - - name: Execute PHPStan - run: phpstan analyze --no-progress - - php-codesniffer: - - name: PHP-CodeSniffer - ${{ inputs.php-version }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - coverage: none - tools: php-cs-fixer, phpcs, composer:${{ inputs.composer-version }} - - - name: Install Composer dependancies - run: composer install --no-progress --no-interaction - - - name: Execute PHP CodeSniffer - run: phpcs -q - - psalm: - - name: Psalm - ${{ inputs.php-version }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - coverage: none - extensions: mbstring, intl, redis-phpredis/phpredis@6.0.2 - tools: vimeo/psalm, composer:${{ inputs.composer-version }} - env: - REDIS_CONFIGURE_OPTS: --enable-redis-igbinary - - - name: Install Composer dependancies - run: composer install --no-progress --no-interaction - - - name: Execute Psalm - run: psalm --no-progress --output-format=github --root=${GITHUB_WORKSPACE} diff --git a/app/internal/.github/dependabot.yaml b/app/internal/.github/dependabot.yaml deleted file mode 100644 index 9e92476443..0000000000 --- a/app/internal/.github/dependabot.yaml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "composer" - directory: "/" - versioning-strategy: "increase-if-necessary" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/phpcs" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/phpstan" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/psalm" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - groups: - github-action-dependencies: - patterns: - - "*" diff --git a/app/internal/.github/workflows/cd.yaml b/app/internal/.github/workflows/cd.yaml deleted file mode 100644 index f83ebf0b1c..0000000000 --- a/app/internal/.github/workflows/cd.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: CD - -on: - push: - branches: - - main - -jobs: - release-please: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - outputs: - tag_name: ${{ steps.release.outputs.tag_name }} - release_created: ${{ steps.release.outputs.release_created }} - sha: ${{ steps.release.outputs.sha }} - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: php - package-name: olcs-internal diff --git a/app/internal/.github/workflows/ci.yaml b/app/internal/.github/workflows/ci.yaml deleted file mode 100644 index d331f04dff..0000000000 --- a/app/internal/.github/workflows/ci.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: CI - -on: - pull_request: - schedule: - - cron: '0 0 * * 1' - -jobs: - security: - uses: dvsa/.github/.github/workflows/php-security.yml@main - secrets: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - static-analysis: - uses: ./.github/workflows/static-analysis.yaml - with: - php-version: '8.2' - - tests: - uses: dvsa/.github/.github/workflows/php-tests.yml@main - with: - php-versions: "[\"8.2\"]" - fail-fast: false diff --git a/app/internal/.github/workflows/static-analysis.yaml b/app/internal/.github/workflows/static-analysis.yaml deleted file mode 100644 index 38c83538be..0000000000 --- a/app/internal/.github/workflows/static-analysis.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: Static analysis - -on: - workflow_call: - inputs: - php-version: - required: false - type: string - default: 'latest' - composer-version: - required: false - type: string - default: 'v2' - -jobs: - phpstan: - - name: PHPStan - ${{ inputs.php-version }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - coverage: none - tools: phpstan, composer:${{ inputs.composer-version }} - - - name: Install Composer dependancies - run: composer install --no-progress --no-interaction - - - name: Execute PHPStan - run: phpstan analyze --no-progress - - php-codesniffer: - - name: PHP-CodeSniffer - ${{ inputs.php-version }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - coverage: none - tools: php-cs-fixer, phpcs, composer:${{ inputs.composer-version }} - - - name: Install Composer dependancies - run: composer install --no-progress --no-interaction - - - name: Execute PHP CodeSniffer - run: phpcs -q - - psalm: - - name: Psalm - ${{ inputs.php-version }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - coverage: none - extensions: mbstring, intl, redis-phpredis/phpredis@6.0.2 - tools: vimeo/psalm, composer:${{ inputs.composer-version }} - env: - REDIS_CONFIGURE_OPTS: --enable-redis-igbinary - - - name: Install Composer dependancies - run: composer install --no-progress --no-interaction - - - name: Execute Psalm - run: psalm --no-progress --output-format=github --root=${GITHUB_WORKSPACE} diff --git a/app/selfserve/.github/dependabot.yaml b/app/selfserve/.github/dependabot.yaml deleted file mode 100644 index 9e92476443..0000000000 --- a/app/selfserve/.github/dependabot.yaml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "composer" - directory: "/" - versioning-strategy: "increase-if-necessary" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/phpcs" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/phpstan" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "composer" - directory: "/vendor-bin/psalm" - schedule: - interval: "weekly" - groups: - composer-dependencies: - patterns: - - "*" - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - groups: - github-action-dependencies: - patterns: - - "*" diff --git a/app/selfserve/.github/workflows/cd.yaml b/app/selfserve/.github/workflows/cd.yaml deleted file mode 100644 index 5575cc46ca..0000000000 --- a/app/selfserve/.github/workflows/cd.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: CD - -on: - push: - branches: - - main - -jobs: - release-please: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - outputs: - tag_name: ${{ steps.release.outputs.tag_name }} - release_created: ${{ steps.release.outputs.release_created }} - sha: ${{ steps.release.outputs.sha }} - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: php - package-name: olcs-selfserve diff --git a/app/selfserve/.github/workflows/ci.yaml b/app/selfserve/.github/workflows/ci.yaml deleted file mode 100644 index 83d497a0c5..0000000000 --- a/app/selfserve/.github/workflows/ci.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: CI - -on: - pull_request: - schedule: - - cron: '0 0 * * 1' - -jobs: - security: - uses: dvsa/.github/.github/workflows/php-security.yml@main - secrets: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - static-analysis: - uses: dvsa/.github/.github/workflows/php-static.yml@main - with: - php-version: '8.2' - - tests: - uses: dvsa/.github/.github/workflows/php-tests.yml@main - with: - php-versions: '["8.2"]' - fail-fast: false