Search API Pantheon #1472
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: Search API Pantheon | |
on: | |
push: | |
repository_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
inputs: | |
tmate_enabled: | |
description: Enable tmate debugging | |
required: true | |
default: "0" | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 | |
options: --user root | |
name: Code linting | |
env: | |
TZ: "/usr/share/zoneinfo/America/Los_Angeles" | |
TERM: dumb | |
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }} | |
TERMINUS_SITE: ${{ secrets.TERMINUS_SITE }} | |
TERMINUS_ORG: ${{ secrets.TERMINUS_ORG }} | |
GIT_EMAIL: ${{ secrets.GIT_EMAIL }} | |
GITHUB_RUN_NUMBER: ${{ github.run_number }} | |
COMMIT_SHA: ${{ github.sha }} | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
SANDBOX_SSH_KEY: ${{ secrets.SANDBOX_SSH_KEY }} | |
BASH_ENV: ~/.bashrc | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Composer install | |
run: composer install | |
- name: Code sniff | |
run: composer run-script code:lint | |
phpcompatibility: | |
runs-on: ubuntu-latest | |
name: PHP Compatibility | |
steps: | |
- name: PHPCompatibility | |
uses: pantheon-systems/phpcompatibility-action@v1 | |
with: | |
test-versions: 7.4- | |
build_test: | |
strategy: | |
matrix: | |
drupal-version: [ 10 ] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 | |
options: --user root | |
name: Build and test (Drupal ${{ matrix.drupal-version }}) | |
env: | |
TZ: "/usr/share/zoneinfo/America/Los_Angeles" | |
TERM: dumb | |
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }} | |
TERMINUS_SITE: ${{ secrets.TERMINUS_SITE }} | |
TERMINUS_ORG: ${{ secrets.TERMINUS_ORG }} | |
GIT_EMAIL: ${{ secrets.GIT_EMAIL }} | |
GITHUB_RUN_NUMBER: ${{ github.run_number }} | |
COMMIT_SHA: ${{ github.sha }} | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
SANDBOX_SSH_KEY: ${{ secrets.SANDBOX_SSH_KEY }} | |
BASH_ENV: ~/.bashrc | |
DRUPAL_VERSION: ${{ matrix.drupal-version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Login | |
run: | | |
git config --global user.email "$GIT_EMAIL" | |
git config --global user.name "Github Actions" | |
git config --global --add safe.directory '*' | |
mkdir -p /root/.ssh && echo "${{ secrets.SSH_CONFIG }}" >> "/root/.ssh/config" | |
- name: Log in to Terminus | |
run: | | |
terminus auth:login --email=$GIT_EMAIL --machine-token="$TERMINUS_TOKEN" | |
terminus auth:whoami | |
- name: Setup SSH Keys | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SANDBOX_SSH_KEY }} | |
- name: Composer install | |
run: composer install --ignore-platform-req=php | |
- name: Setup tmate session | |
if: ${{ github.event.inputs.tmate_enabled == 1 }} | |
uses: mxschmitt/action-tmate@v3 | |
- name: Run tests | |
run: | | |
export TERMINUS_ORG=$TERMINUS_ORG | |
./vendor/bin/robo test:full $DRUPAL_VERSION $TERMINUS_SITE | |
- name: Cleanup sites | |
if: ${{ always() }} | |
run: | | |
./vendor/bin/robo test:delete-sites | |
mirror_do: | |
runs-on: ubuntu-latest | |
name: Checkout & push to remote | |
if: ${{ github.repository == 'pantheon-systems/search_api_pantheon' }} | |
needs: [ build_test ] | |
env: | |
BRANCH: ${{ github.ref_name }} | |
WORKSPACE: ${{ github.workspace }} | |
DRUPAL_ORG_REMOTE: ${{ secrets.DRUPAL_ORG_REMOTE }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
if_key_exists: ignore | |
- name: Pushes to drupal.org repository | |
run: | | |
cd $WORKSPACE | |
git remote add drupalorg $DRUPAL_ORG_REMOTE | |
git push drupalorg $BRANCH |