Use a local GitLab for testing #1960
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
name: Test | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # everyday at midnight | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
container: ubuntu:24.04 | |
services: | |
gitlab: | |
image: gitlab/gitlab-ee | |
env: | |
GITLAB_OMNIBUS_CONFIG: "external_url 'http://gitlab'; gitlab_rails['lfs_enabled'] = true; gitlab_rails['initial_root_password'] = 'MySuperSecretAndSecurePassw0rd!';" | |
strategy: | |
fail-fast: true | |
max-parallel: 2 | |
matrix: | |
php-version: | |
# - "7.3" | |
- "7.4" | |
#- "8.0" | |
#- "8.1" | |
# - "8.2" | |
# - "8.3" | |
# - "8.4" | |
composer-version: | |
- "2" | |
steps: | |
- run: | | |
apt-get update | |
apt-get install bash curl -y | |
curl --user 'root:MySuperSecretAndSecurePassw0rd!' gitlab/api/v4/users -v | |
- name: Dump matrix context | |
env: | |
MATRIX_CONTEXT: ${{ toJSON(matrix) }} | |
run: echo "$MATRIX_CONTEXT" && exit 1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Update composer | |
run: composer --verbose self-update --${{ matrix.composer-version }} | |
- name: Dump composer verson | |
run: composer --version | |
- name: Validate composer.json | |
run: composer --verbose validate | |
- name: Install dependencies | |
run: composer --verbose install | |
- name: Build test image | |
run: docker build --build-arg COMPOSER_VERSION=$COMPOSER_VERSION --build-arg PHP_VERSION=$PHP_VERSION -t update-check-runner . | |
env: | |
COMPOSER_VERSION: ${{ matrix.composer-version }} | |
PHP_VERSION: ${{ matrix.php-version }} | |
- name: Run phpstan | |
run: composer phpstan | |
- run: | | |
git status | |
export MY_COMMIT=$(git log --format=format:%H -n1) | |
echo $MY_COMMIT | |
echo "COMMIT_SHA=$MY_COMMIT" >> $GITHUB_OUTPUT | |
id: log | |
- name: Coding style | |
run: composer phpcs | |
- name: Run tests | |
run: ./vendor/bin/phpunit | |
env: | |
COMPOSER_VERSION: ${{ matrix.composer-version }} | |
PHP_VERSION: ${{ matrix.php-version }} | |
GITHUB_PRIVATE_USER_TOKEN: ${{ secrets.GH_PRIVATE_USER_TOKEN }} | |
GITHUB_PRIVATE_REPO: ${{ secrets.GH_PRIVATE_REPO }} | |
GITLAB_PRIVATE_REPO: ${{ secrets.GITLAB_PRIVATE_REPO }} | |
MY_COMMIT: ${{ steps.log.outputs.COMMIT_SHA }} | |
SELF_HOSTED_GITLAB_PRIVATE_USER_TOKEN: ${{ secrets.SELF_HOSTED_GITLAB_PRIVATE_USER_TOKEN }} | |
SELF_HOSTED_GITLAB_PRIVATE_REPO: ${{ secrets.SELF_HOSTED_GITLAB_PRIVATE_REPO }} | |
BITBUCKET_CLIENT_ID: ${{ secrets.BITBUCKET_CLIENT_ID }} | |
BITBUCKET_CLIENT_SECRET: ${{ secrets.BITBUCKET_CLIENT_SECRET }} | |
BITBUCKET_REDIRECT_URI: ${{ secrets.BITBUCKET_REDIRECT_URI }} | |
BITBUCKET_REFRESH_TOKEN: ${{ secrets.BITBUCKET_REFRESH_TOKEN }} | |
BITBUCKET_PRIVATE_REPO: ${{ secrets.BITBUCKET_PRIVATE_REPO }} | |
GITHUB_DRUPAL8_CONTRIB_PRIVATE_REPO: ${{ secrets.GH_DRUPAL8_CONTRIB_PRIVATE_REPO }} | |
GITLAB_PRIVATE_REPO_NESTED_GROUP: ${{ secrets.GITLAB_PRIVATE_REPO_NESTED_GROUP }} | |
GITHUB_PUBLIC_REPO: ${{ secrets.GH_PUBLIC_REPO }} | |
GITHUB_PUBLIC_PROJECT_NID: ${{ secrets.GH_PUBLIC_PROJECT_NID }} | |
GITHUB_FORK_TO: ${{ secrets.GH_FORK_TO }} | |
TOKEN_URL: ${{ secrets.TOKEN_URL }} | |
FORK_USER: ${{ secrets.FORK_USER }} | |
FORK_MAIL: ${{ secrets.FORK_MAIL }} | |
GITHUB_BUNDLED_REPO: ${{ secrets.GH_BUNDLED_REPO }} | |
GITHUB_SECURITY_ONLY_REPO: ${{ secrets.GH_SECURITY_ONLY_REPO }} | |
GITHUB_CONCURRENT_REPO: ${{ secrets.GH_CONCURRENT_REPO }} | |
GITLAB_ASSIGNEE_REPO: ${{ secrets.GITLAB_ASSIGNEE_REPO }} | |
GITHUB_REPO_ENV_REQUIRED: ${{ secrets.GH_REPO_ENV_REQUIRED }} | |
GITLAB_REPO_GITHUB_DEP: ${{ secrets.GITLAB_REPO_GITHUB_DEP }} | |
SELF_HOSTED_GITLAB_PERSONAL_ACCESS_TOKEN: ${{ secrets.SELF_HOSTED_GITLAB_PERSONAL_ACCESS_TOKEN }} | |
GITHUB_DEFAULT_BRANCH_IN_CONFIG: ${{ secrets.GH_DEFAULT_BRANCH_IN_CONFIG }} | |
GITHUB_PRIVATE_UPDATE_ALL_REPO: ${{ secrets.GH_PRIVATE_UPDATE_ALL_REPO }} | |
GITHUB_PRIVATE_INDIRECT_WITH_DIRECT: ${{ secrets.GH_PRIVATE_INDIRECT_WITH_DIRECT }} | |
GITLAB_SUPER_SECRET_URL_FOR_TOKEN: ${{ secrets.GITLAB_SUPER_SECRET_URL_FOR_TOKEN }} | |
VALID_CI_LICENCE: ${{ secrets.VALID_CI_LICENCE }} |