Skip to content

Commit

Permalink
Merge pull request #6069 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.2.0 Ready code
  • Loading branch information
MGatner authored Jun 3, 2022
2 parents 202f41a + b4ed2fc commit 394a6c6
Show file tree
Hide file tree
Showing 2,120 changed files with 38,896 additions and 16,803 deletions.
18 changes: 10 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
; top-most EditorConfig file
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

; Unix-style newlines
[*]
end_of_line = lf

[*.php]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,24 @@ contributing/ export-ignore
.editorconfig export-ignore
.nojekyll export-ignore export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
PULL_REQUEST_TEMPLATE.md export-ignore
stale.yml export-ignore
Vagrantfile.dist export-ignore

# They don't want our test files
tests/AutoReview/ export-ignore
tests/system/ export-ignore
utils/ export-ignore
depfile.yaml export-ignore
rector.php export-ignore
phpunit.xml.dist export-ignore
phpstan-baseline.neon.dist export-ignore
phpstan.neon.dist export-ignore
phpstan-bootstrap.php export-ignore
.php-cs-fixer.dist.php export-ignore
.php-cs-fixer.no-header.php export-ignore
.php-cs-fixer.user-guide.php export-ignore

# The source user guide, either
user_guide_src/ export-ignore
Expand Down
36 changes: 36 additions & 0 deletions .github/scripts/deploy-userguide
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

## Deploy codeigniter4/userguide

# Setup variables
SOURCE=$1
TARGET=$2
RELEASE=$3
VERSION=`echo "$RELEASE" | cut -c 2-`

echo "Preparing for version $3"
echo "Merging files from $1 to $2"

# Prepare the source
cd $SOURCE
git checkout master
cd user_guide_src
make html
make epub

# Prepare the target
cd $TARGET
git checkout master
rm -rf docs

# Copy files
cp -Rf ${SOURCE}/user_guide_src/build/html ./docs
cp -Rf ${SOURCE}/user_guide_src/build/epub/CodeIgniter.epub ./CodeIgniter${VERSION}.epub

# Ensure underscore prefixed files are published
touch ${TARGET}/docs/.nojekyll

# Commit the changes
git add .
git commit -m "Release ${RELEASE}"
git push
4 changes: 2 additions & 2 deletions .github/workflows/deploy-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
git config --global user.name "${GITHUB_ACTOR}"
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: source

- name: Checkout target
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: codeigniter4/api
token: ${{ secrets.ACCESS_TOKEN }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deploy-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
git config --global user.name "${GITHUB_ACTOR}"
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: source

- name: Checkout target
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: codeigniter4/framework
token: ${{ secrets.ACCESS_TOKEN }}
Expand All @@ -36,7 +36,7 @@ jobs:
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
Expand All @@ -63,12 +63,12 @@ jobs:
git config --global user.name "${GITHUB_ACTOR}"
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: source

- name: Checkout target
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: codeigniter4/appstarter
token: ${{ secrets.ACCESS_TOKEN }}
Expand All @@ -81,7 +81,7 @@ jobs:
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/deploy-userguide-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none

# Build the latest User Guide
- name: Build with Sphinx
uses: ammaraskar/[email protected]
with:
docs-folder: user_guide_src/

- name: Add "Edit this page" links
run: |
cd user_guide_src
# Fix permissions
sudo chown -R runner:docker build/html/
php add-edit-this-page build/html/
# Create an artifact of the html output
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: HTML Documentation
path: user_guide_src/build/html/
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/deploy-userguide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# When a new Release is created, deploy relevant
# files to each of the generated repos.
name: Deploy User Guide

on:
release:
types: [published]

jobs:
framework:
name: Deploy to userguide
if: (github.repository == 'codeigniter4/CodeIgniter4')
runs-on: ubuntu-latest
steps:
- name: Identify
run: |
git config --global user.email "[email protected]"
git config --global user.name "${GITHUB_ACTOR}"
- name: Checkout source
uses: actions/checkout@v3
with:
path: source

- name: Checkout target
uses: actions/checkout@v3
with:
repository: codeigniter4/userguide
token: ${{ secrets.ACCESS_TOKEN }}
path: userguide

- name: Install Sphinx
run: |
sudo apt install python3-sphinx
sudo pip3 install sphinxcontrib-phpdomain
sudo pip3 install sphinx_rtd_theme
- name: Chmod
run: chmod +x ./source/.github/scripts/deploy-userguide

- name: Deploy
run: ./source/.github/scripts/deploy-userguide ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/userguide ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v6
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
const release = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: 'userguide',
tag_name: release.data.tag_name,
name: release.data.name,
body: release.data.body
})
49 changes: 49 additions & 0 deletions .github/workflows/test-autoreview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Automatic Code Review

on:
pull_request:
paths:
- composer.json
- spark
- '**.php'
- .github/workflows/test-autoreview.yml
push:
paths:
- composer.json
- spark
- '**.php'
- .github/workflows/test-autoreview.yml

jobs:
auto-review-tests:
name: Automatic Code Review
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer update --ansi
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Run AutoReview Tests
run: vendor/bin/phpunit --color=always --group=auto-review --no-coverage
10 changes: 6 additions & 4 deletions .github/workflows/test-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
fail-fast: false
matrix:
php-version:
- '7.3'
- '7.4'
- '8.0'

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -41,7 +40,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -53,7 +52,10 @@ jobs:
run: composer update --ansi --no-interaction

- name: Run lint on `app/`, `admin/`, `public/`
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.no-header.php-cs-fixer.dist.php --using-cache=no --diff
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff

- name: Run lint on `system/`, `tests`, `utils/`, and root PHP files
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff

- name: Run lint on `user_guide_src/source/`
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff
18 changes: 9 additions & 9 deletions .github/workflows/test-deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ on:
pull_request:
branches:
- 'develop'
- '4.*'
- 'v4.*'
paths:
- 'app/**'
- 'system/**'
- 'app/**.php'
- 'system/**.php'
- 'composer.json'
- 'depfile.yaml'
- '.github/workflows/test-deptrac.yml'
push:
branches:
- 'develop'
- '4.*'
- 'v4.*'
paths:
- 'app/**'
- 'system/**'
- 'app/**.php'
- 'system/**.php'
- 'composer.json'
- 'depfile.yaml'
- '.github/workflows/test-deptrac.yml'
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -50,7 +50,7 @@ jobs:
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}

- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -60,7 +60,7 @@ jobs:
run: mkdir -p build/

- name: Cache Deptrac results
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-deptrac-${{ github.sha }}
Expand Down
Loading

0 comments on commit 394a6c6

Please sign in to comment.