-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed Travis CI config + added Github Actions + dependabot config
fixed installer tests (changed composer.json branch name from dev-master to dev-main) updated Devcontainer and Dockerfile
- Loading branch information
Showing
10 changed files
with
166 additions
and
135 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,49 +1,24 @@ | ||
FROM php:7.4-cli | ||
FROM mcr.microsoft.com/devcontainers/php:8 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
# Setup system dependecies | ||
RUN apt-get update && apt-get install -y \ | ||
# for PhantomJS | ||
fontconfig \ | ||
# for PHP extension: bzip | ||
bzip2 libbz2-dev \ | ||
# for PHP extension: intl | ||
libicu-dev \ | ||
# for PHP extension: gettext | ||
gettext | ||
|
||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
# Setup PHP dependencies | ||
RUN docker-php-ext-install \ | ||
bz2 \ | ||
gettext \ | ||
intl \ | ||
pdo \ | ||
pdo_mysql | ||
|
||
# Configure apt and install packages | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ | ||
&& apt-get -y install git openssh-client less iproute2 procps lsb-release unzip \ | ||
&& apt-get -y install libfontconfig1 libbz2-dev libzip-dev \ | ||
# | ||
# Xdebug | ||
&& yes | pecl install xdebug \ | ||
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ | ||
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
# | ||
# Create a non-root user to use if preferred | ||
&& groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
# [Optional] Add sudo support for the non-root user | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
# | ||
# Clean up | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
# | ||
# Install Composer v1, then self-update to snapshot of v2 | ||
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ | ||
&& composer self-update --snapshot \ | ||
&& composer --version | ||
|
||
# For PhantomJS | ||
ENV OPENSSL_CONF=/etc/ssl/ | ||
|
||
# Install bz2, requires libbz2-dev | ||
RUN docker-php-ext-install bz2 | ||
|
||
# Install zip, requires libzip-dev zlib1g-dev | ||
RUN docker-php-ext-configure zip | ||
RUN docker-php-ext-install zip | ||
|
||
ENV DEBIAN_FRONTEND=dialog | ||
# Update Composer | ||
ENV COMPOSER_ALLOW_SUPERUSER=1 | ||
RUN composer self-update |
This file contains 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 |
---|---|---|
@@ -1,29 +1,24 @@ | ||
{ | ||
"name": "PHP 7 + Composer + phantomjs-installer", | ||
"name": "PHP", | ||
"dockerFile": "Dockerfile", | ||
|
||
// Use 'settings' to set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
// config settings you would have in ".vscode/settings.json" | ||
"customizations": { | ||
"vscode": { | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
// VS Code specific | ||
"EditorConfig.EditorConfig", | ||
// Asciidoc specific | ||
"asciidoctor.asciidoctor-vscode", | ||
// Markdown specific | ||
"yzhang.markdown-all-in-one", | ||
// PHP specific | ||
"xdebug.php-pack" | ||
], | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
} | ||
} | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created in the array below. | ||
"extensions": [ | ||
"felixfbecker.php-debug", | ||
"felixfbecker.php-intellisense", | ||
//"shd101wyy.markdown-preview-enhanced", | ||
//"auchenberg.vscode-browser-preview", | ||
//"whatwedo.twig", | ||
//"mtxr.sqltools" | ||
], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "php -v", | ||
|
||
// Comment out if you want to use root | ||
"remoteUser": "vscode" | ||
|
||
} | ||
"remoteUser": "root" | ||
} |
This file contains 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
This file contains 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,8 @@ | ||
version: 2 | ||
updates: | ||
# Enable version updates for github-actions | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
# Check for updates to GitHub Actions once a month | ||
interval: 'monthly' |
This file contains 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,74 @@ | ||
name: CI | ||
|
||
on: [workflow_dispatch, push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
test: | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# https://www.php.net/supported-versions.php | ||
version: ['8.1', '8.2', '8.3', '8.4'] | ||
|
||
# ubuntu-latest = ubuntu-22.04 (06-2024) | ||
# /~https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
|
||
- name: 🤘 Checkout | ||
uses: actions/checkout@v4 # /~https://github.com/actions/checkout | ||
with: | ||
fetch-depth: 5 | ||
|
||
# install location of tools is /usr/local/bin/phpunit | ||
- name: 🔽 Setup PHP | ||
uses: shivammathur/setup-php@v2 # /~https://github.com/shivammathur/setup-php | ||
with: | ||
php-version: ${{matrix.version}} | ||
extensions: dom, mbstring, tidy | ||
ini-values: memory_limit=-1, error_reporting=-1, display_errors=On | ||
tools: composer, phpunit | ||
|
||
- name: 🔽 Setup problem matchers for PHP | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
|
||
- name: ✅ PHP lint | ||
run: find . -path ./vendor -prune -o -type f -name '*.php' ! -name "test_with_parse_error.php" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) | ||
|
||
- name: 🔴🟢🟢🟢 Test | ||
run: /usr/local/bin/phpunit --configuration ./tests/phpunit.xml.dist | ||
|
||
- name: Update Composer | ||
run: | | ||
composer self-update | ||
composer diagnose | ||
# This tests the installation of the installer using require "dev-main", | ||
# along with the installation of the latest version of PhantomJS. | ||
- name: Installer "dev-main" installs latest PhantomJS version | ||
run: | | ||
cd tests/example-latest-version | ||
composer install -vvv --profile | ||
ls -ashF bin | ||
bin/phantomjs -v | ||
# This tests the installation of the installer using require "dev-main", | ||
# along with the installation of a manually specified PhantomJS version "v2.1.1", | ||
# as defined in the extra section of composer.json. | ||
# | ||
# Reminder: | ||
# If you define version "2.0.0" in composer.json's extra section, | ||
# it should fetch v1.9.8 via retry/auto-lowering, because 2.0.0 doesnt exist. | ||
# | ||
- name: Installer "dev-main" installs a manually specific PhantomJS version | ||
run: | | ||
cd tests/example-extra-version | ||
composer install -vvv --profile | ||
ls -ashF bin | ||
bin/phantomjs -v |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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