-
Notifications
You must be signed in to change notification settings - Fork 49
Implement comprehensive CI/CD pipeline with automated quality checks and deployment workflows #305
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
Open
claytoncollie
wants to merge
10
commits into
trunk
Choose a base branch
from
feature/ci-pipeline-clayton
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e7160a7
Coding standards and code quality
claytoncollie 00360a2
Build and Deploy jobs
claytoncollie cc0ff92
Create dependecies
claytoncollie b3d2f8e
Change cache key
claytoncollie 0792d68
Fix paths
claytoncollie 904922b
Permissions and concurrency
claytoncollie e680a7c
Remove deps and nesting
claytoncollie b4d0b02
Permissions for single jobs
claytoncollie 50a9bc5
validate composer file
claytoncollie 21036b7
Code review fixes
claytoncollie 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,11 @@ | ||
| name: Code Quality | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| trufflehog: | ||
| uses: ./.github/workflows/jobs/truffle-hog.yml | ||
|
|
||
| virus-scan: | ||
| uses: ./.github/workflows/jobs/virus-scan.yml | ||
|
||
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,20 @@ | ||
| name: Coding Standards | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| stylelint: | ||
| uses: ./.github/workflows/jobs/stylelint.yml | ||
|
|
||
| eslint: | ||
|
||
| uses: ./.github/workflows/jobs/eslint.yml | ||
|
|
||
| jest: | ||
|
||
| uses: ./.github/workflows/jobs/jest.yml | ||
|
|
||
| phpcs: | ||
|
||
| uses: ./.github/workflows/jobs/phpcs.yml | ||
|
|
||
| phpstan: | ||
|
||
| uses: ./.github/workflows/jobs/phpstan.yml | ||
|
||
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,25 @@ | ||
| name: Deploy to Develop | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - develop | ||
|
|
||
| jobs: | ||
| lint: | ||
| uses: ./.github/workflows/coding-standards.yml | ||
|
|
||
| test: | ||
|
||
| uses: ./.github/workflows/code-quality.yml | ||
| needs: lint | ||
|
|
||
| build: | ||
|
||
| uses: ./.github/workflows/jobs/build.yml | ||
| needs: test | ||
|
|
||
| deploy: | ||
|
||
| uses: ./.github/workflows/jobs/deploy.yml | ||
| needs: build | ||
| with: | ||
| name: develop | ||
| url: https://develop.fueled.com | ||
|
||
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,88 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: "npm" | ||
|
|
||
| - name: Get npm cache directory | ||
| id: npm-cache-dir | ||
| run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
|
|
||
| - name: Cache npm dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-node- | ||
|
|
||
| - name: Check Node version | ||
| run: node -v | ||
|
|
||
| - name: Setup NPM | ||
| run: npm install -g npm@latest | ||
|
|
||
| - name: Check Node version | ||
| run: npm -v | ||
|
|
||
| - name: Install Node dependencies | ||
| run: npm install | ||
|
|
||
| - name: Build JavaScript | ||
| run: npm run build | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: "8.4" | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Get Composer cache directory | ||
| id: composer-cache | ||
| run: echo "dir=$(composer config cache-files-dir)" >> ${GITHUB_OUTPUT} | ||
|
|
||
| - name: Cache Composer dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-php- | ||
|
|
||
| - name: PHP Version | ||
| run: php -v | ||
|
|
||
| - name: Install Root dependencies | ||
| run: composer install --no-dev --prefer-dist --no-progress | ||
|
|
||
| - name: Install Plugin dependencies | ||
| run: composer install --no-dev --prefer-dist --no-progress --working-dir=mu-plugins/10up-plugin | ||
|
|
||
| - name: Install Theme dependencies | ||
| run: composer install --no-dev --prefer-dist --no-progress --working-dir=themes/10up-theme | ||
|
|
||
| - name: Upload build artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.name }}-payload | ||
| retention-days: 7 | ||
| include-hidden-files: true | ||
| path: . | ||
|
|
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,31 @@ | ||
| name: Deploy | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| name: | ||
| required: true | ||
| type: string | ||
| url: | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| environment: | ||
| name: ${{ inputs.name }} | ||
| url: ${{ inputs.url }} | ||
|
|
||
| steps: | ||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.name }}-payload | ||
|
|
||
| # TODO: Implement deployment | ||
|
|
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,48 @@ | ||
| name: JavaScript Coding Standards | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| eslint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: "npm" | ||
|
|
||
| - name: Get npm cache directory | ||
| id: npm-cache-dir | ||
| run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
|
|
||
| - name: Cache npm dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-node- | ||
|
|
||
| - name: Check Node version | ||
| run: node -v | ||
|
|
||
| - name: Setup NPM | ||
| run: npm install -g npm@latest | ||
|
|
||
| - name: Check NPM version | ||
| run: npm -v | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Run Lint JS | ||
| run: npm run lint-js |
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,48 @@ | ||
| name: JavaScript Unit Tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| jest: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: "npm" | ||
|
|
||
| - name: Get npm cache directory | ||
| id: npm-cache-dir | ||
| run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
|
|
||
| - name: Cache npm dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-node- | ||
|
|
||
| - name: Check Node version | ||
| run: node -v | ||
|
|
||
| - name: Setup NPM | ||
| run: npm install -g npm@latest | ||
|
|
||
| - name: Check NPM version | ||
| run: npm -v | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Run Jest | ||
| run: npm run test |
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,54 @@ | ||
| name: PHP Coding Standards | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| phpcs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP with composer v2 | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: "8.3" | ||
| tools: composer:v2 | ||
|
|
||
| - name: Validate Root composer.json and composer.lock | ||
| run: composer validate --strict | ||
|
|
||
| - name: Validate Plugin composer.json and composer.lock | ||
| run: composer validate --strict --working-dir=mu-plugins/10up-plugin | ||
|
|
||
| - name: Validate Theme composer.json and composer.lock | ||
| run: composer validate --strict --working-dir=themes/10up-theme | ||
|
|
||
| - name: Get Composer Cache Directory | ||
| id: composer-cache | ||
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Cache Composer dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-php- | ||
|
|
||
| - name: Install Root dependencies | ||
| run: composer install --prefer-dist --no-progress | ||
|
|
||
| - name: Install Plugin dependencies | ||
| run: composer install --prefer-dist --no-progress --working-dir=mu-plugins/10up-plugin | ||
|
|
||
| - name: Install Theme dependencies | ||
| run: composer install --prefer-dist --no-progress --working-dir=themes/10up-theme | ||
|
|
||
| - name: Run PHPCS | ||
| run: composer lint |
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
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.
Uh oh!
There was an error while loading. Please reload this page.