Skip to content

Commit

Permalink
Merge pull request #318 from UN-OCHA/develop
Browse files Browse the repository at this point in the history
CERF and CBPF Page Search Redirect
  • Loading branch information
maheshtrigyn authored Jun 12, 2023
2 parents d68b270 + ceaf4ad commit 7164399
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 118 deletions.
48 changes: 40 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
id: checkout
uses: actions/checkout@v3

- name: Extract PHP Version
id: php
uses: docker://ghcr.io/un-ocha/actions:extract-php-version-main
with:
docker_file: 'docker/Dockerfile'
docker_image: 'public.ecr.aws/unocha/php-k8s'

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
if: ${{ !env.ACT }}
with:
php-version: ${{ steps.php.outputs.php_version }}
tools: composer
env:
fail-fast: true

- name: Setup PHP with PECL extension locally
uses: shivammathur/setup-php@v2
if: ${{ env.ACT }}
with:
php-version: 8.0
php-version: ${{ steps.php.outputs.php_version }}
tools: composer
env:
fail-fast: true
runner: self-hosted

- name: Software versions
id: versions
Expand All @@ -22,10 +44,6 @@ jobs:
run: |
php --version && composer --version
- name: Checkout Code
id: checkout
uses: actions/checkout@v3

- name: Composer Validate
id: validate
uses: cafuego/command-output@main
Expand All @@ -47,14 +65,16 @@ jobs:

- name: Configure AWS Credentials
id: aws
uses: aws-actions/configure-aws-credentials@v1-node16
if: ${{ !env.ACT }}
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Public ECR
id: aws-login
if: ${{ !env.ACT }}
uses: docker/[email protected]
with:
registry: public.ecr.aws
Expand Down Expand Up @@ -147,6 +167,7 @@ jobs:
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
if: ${{ !env.ACT }}
with:
github: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
Expand All @@ -155,6 +176,7 @@ jobs:

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2
if: ${{ !env.ACT }}
with:
github: ${{ secrets.GITHUB_TOKEN }}
comment-id: ${{ steps.fc.outputs.comment-id }}
Expand Down Expand Up @@ -184,7 +206,7 @@ jobs:

- name: Slack Success Notification
id: slack_success
if: success()
if: ${{ !env.ACT && success() }}
uses: slackapi/[email protected]
with:
channel-id: '${{ secrets.SLACK_CHANNEL }}'
Expand All @@ -211,7 +233,7 @@ jobs:

- name: Slack Failure Notification
id: slack_failure
if: failure()
if: ${{ !env.ACT && failure() }}
uses: slackapi/[email protected]
with:
channel-id: '${{ secrets.SLACK_CHANNEL }}'
Expand All @@ -235,3 +257,13 @@ jobs:
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Clean up
id: docker-clean-up
if: ${{ env.ACT }}
uses: cafuego/command-output@main
with:
run: |
docker compose -f tests/docker-compose.yml down
env:
fail-fast: true
Loading

0 comments on commit 7164399

Please sign in to comment.