Skip to content

Upgraded to Drupal 11. #218

Upgraded to Drupal 11.

Upgraded to Drupal 11. #218

# 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:24.11.0
env:
# Prevent GitHub overriding the Docker config.
DOCKER_CONFIG: /root/.docker
VORTEX_DOCTOR_CHECK_MINIMAL: 1
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_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_MOUNTED: 0
VORTEX_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- 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: 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: Install dependencies
run: npm ci
working-directory: .vortex/tests
- name: Lint code
run: |
./tests/lint.scripts.sh
./tests/lint.dockerfiles.sh
working-directory: .vortex
- name: Run tests
run: ./tests/test.common.sh
working-directory: .vortex
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-code-coverage-report
path: /tmp/.vortex-coverage-html
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@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]
container:
image: drevops/ci-runner:24.11.0
env:
# Prevent GitHub overriding the Docker config.
DOCKER_CONFIG: /root/.docker
VORTEX_DOCTOR_CHECK_MINIMAL: 1
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_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_MOUNTED: 0
VORTEX_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html
TEST_NODE_INDEX: ${{ matrix.batch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Adjust git config to allow running git-related tests
run: git config --global safe.directory '*'
- name: Install dependencies
run: npm ci
working-directory: .vortex/tests
- name: Run tests
run: ./tests/test.workflow.sh
working-directory: .vortex
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-${{ matrix.batch }}-code-coverage-report
path: /tmp/.vortex-coverage-html
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v5
with:
directory: /tmp/.vortex-coverage-html
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
vortex-test-deployment:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
batch: [0, 1]
container:
image: drevops/ci-runner:24.11.0
env:
# Prevent GitHub overriding the Docker config.
DOCKER_CONFIG: /root/.docker
VORTEX_DOCTOR_CHECK_MINIMAL: 1
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_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_MOUNTED: 0
VORTEX_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html
TEST_NODE_INDEX: ${{ matrix.batch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
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: Install dependencies
run: npm ci
working-directory: .vortex/tests
- name: Run tests
run: ./tests/test.deployment.sh
working-directory: .vortex
timeout-minutes: 10
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-${{ matrix.batch }}-code-coverage-report
path: /tmp/.vortex-coverage-html
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@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@v4
- 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:'
continue-on-error: ${{ vars.VORTEX_CI_ACTIONLINT_IGNORE_FAILURE == '1' }}