Skip to content

[#1923] Added Slack notifications, docs and selection in the installer. #1984

[#1923] Added Slack notifications, docs and selection in the installer.

[#1923] Added Slack notifications, docs and selection in the installer. #1984

# This action is used for Vortex maintenance. It will not be used in the scaffolded project.
name: Vortex - Test
on:
push:
branches:
- develop
pull_request:
branches:
- develop
- 'feature/**'
- 'bugfix/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
vortex-test-common:
runs-on: ubuntu-latest
container:
image: drevops/ci-runner:25.10.0@sha256:03f2722e141b4939b390abad9443ed96304a8ec7bda0b2eab9dac56f9e9b7b91
env:
# Prevent GitHub overriding the Docker config.
DOCKER_CONFIG: /root/.docker
VORTEX_DOCTOR_CHECK_MINIMAL: 1
TEST_PACKAGE_TOKEN: ${{ secrets.TEST_PACKAGE_TOKEN }}
TEST_VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_USER }}
TEST_VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_PASS }}
VORTEX_DEV_VOLUMES_SKIP_MOUNT: 1
VORTEX_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
persist-credentials: false
- name: Adjust git config to allow running git-related tests
run: git config --global safe.directory '*'
- name: Process codebase to run in CI
run: find . -name "docker-compose.yml" -print0 | xargs -0 -I {} sh -c "sed -i -e ''/###/d'' {} && sed -i -e ''s/##//'' {}"
- name: Login to container registry
run: ./scripts/vortex/login-container-registry.sh
env:
VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
- name: Generate test SSH key pair used for deployment tests
run: |
mkdir -p "$HOME/.ssh"
ssh-keygen -t rsa -b 4096 -m PEM -N '' -f "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
ssh-agent -a "${HOME}/ssh-agent.sock" > ssh-agent-output
export SSH_AUTH_SOCK=$(grep SSH_AUTH_SOCK ssh-agent-output | cut -d';' -f1 | cut -d= -f2)
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> "$GITHUB_ENV"
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22.17.1
- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: .vortex/tests
- name: Lint code
run: |
./tests/lint.scripts.sh
./tests/lint.dockerfiles.sh
./tests/lint.markdown.sh
working-directory: .vortex
# Special case to validate Renovate configuration with the same action
# as used in the Renovate workflow to ensure that they both use the same
# version.
- name: Validate Renovate configuration
uses: suzuki-shunsuke/github-action-renovate-config-validator@c22827f47f4f4a5364bdba19e1fe36907ef1318e # v1.1.1
- name: Install Ahoy
run: |
version=2.4.0 && \
set -x && curl -L -o "/usr/local/bin/ahoy" "https://github.com/ahoy-cli/ahoy/releases/download/v${version}/ahoy-bin-$(uname -s)-amd64" && \
chmod +x /usr/local/bin/ahoy && \
ahoy --version
- name: Run tests
run: ./tests/test.common.sh
working-directory: .vortex
env:
TEST_VORTEX_DEBUG: ${{ vars.TEST_VORTEX_DEBUG }}
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
with:
name: ${{github.job}}-code-coverage-report
path: /tmp/.vortex-coverage-html
include-hidden-files: true
if-no-files-found: error
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
with:
directory: /tmp/.vortex-coverage-html
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
vortex-test-workflow:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
batch: [0, 1, 2, 3, 4]
container:
image: drevops/ci-runner:25.10.0@sha256:03f2722e141b4939b390abad9443ed96304a8ec7bda0b2eab9dac56f9e9b7b91
env:
# Prevent GitHub overriding the Docker config.
DOCKER_CONFIG: /root/.docker
VORTEX_DOCTOR_CHECK_MINIMAL: 1
TEST_PACKAGE_TOKEN: ${{ secrets.TEST_PACKAGE_TOKEN }}
TEST_VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_USER }}
TEST_VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_PASS }}
VORTEX_DEV_VOLUMES_SKIP_MOUNT: 1
VORTEX_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html
TEST_NODE_INDEX: ${{ matrix.batch }}
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
persist-credentials: false
- name: Adjust git config to allow running git-related tests
run: git config --global safe.directory '*'
- name: Generate test SSH key pair used for deployment tests
run: |
mkdir -p "$HOME/.ssh"
ssh-keygen -t rsa -b 4096 -m PEM -N '' -f "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
ssh-agent -a "${HOME}/ssh-agent.sock" > ssh-agent-output
export SSH_AUTH_SOCK=$(grep SSH_AUTH_SOCK ssh-agent-output | cut -d';' -f1 | cut -d= -f2)
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> "$GITHUB_ENV"
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22.17.1
- name: Install dependencies
run: composer install
working-directory: .vortex/tests
- name: Install Ahoy
run: |
version=2.4.0 && \
set -x && curl -L -o "/usr/local/bin/ahoy" "https://github.com/ahoy-cli/ahoy/releases/download/v${version}/ahoy-bin-$(uname -s)-amd64" && \
chmod +x /usr/local/bin/ahoy && \
ahoy --version
- name: Run tests
run: |
# Create an empty coverage directory to avoid errors. @see https://github.com/actions/upload-artifact/issues/255
mkdir -p /tmp/.vortex-coverage-html && touch "/tmp/.vortex-coverage-html/.empty-$(date +%Y%m%d%H%M%S)"
# Configure git username and email if it is not set.
[ "$(git config --global user.name)" = "" ] && echo "==> Configuring global test git user name" && git config --global user.name "Test user"
[ "$(git config --global user.email)" = "" ] && echo "==> Configuring global test git user email" && git config --global user.email "[email protected]"
# Create stub of local network.
docker network create amazeeio-network 2>/dev/null || true
php -d memory_limit=-1 vendor/bin/phpunit --group="p${TEST_NODE_INDEX:-*}"
working-directory: .vortex/tests
env:
TEST_VORTEX_DEBUG: ${{ vars.TEST_VORTEX_DEBUG }}
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
with:
name: ${{github.job}}-${{ matrix.batch }}-code-coverage-report
path: /tmp/.vortex-coverage-html
include-hidden-files: true
if-no-files-found: error
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
with:
directory: /tmp/.vortex-coverage-html
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
vortex-test-actions:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Login to container registry
run: ./scripts/vortex/login-container-registry.sh
env:
VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
- name: Check coding standards with yamllint
run: yamllint --config-file .vortex/tests/.yamllint-for-gha.yml .github/workflows
continue-on-error: ${{ vars.VORTEX_CI_YAMLLINT_IGNORE_FAILURE == '1' }}
- name: Check coding standards with actionlint
run: docker run --rm -v "${GITHUB_WORKSPACE:-.}":/app --workdir /app rhysd/actionlint:1.7.2 -ignore 'SC2002:' -ignore 'SC2155:' -ignore 'SC2015:' -ignore 'SC2046:' -ignore 'SC1090:'
continue-on-error: ${{ vars.VORTEX_CI_ACTIONLINT_IGNORE_FAILURE == '1' }}