Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: 'GitHub Actions'
'on':
- push
concurrency: 'ci-${{ github.ref }}'
env:
APP_IMAGE: keboola-component
KBC_DEVELOPERPORTAL_VENDOR: keboola
KBC_DEVELOPERPORTAL_APP: keboola.runner-config-test
KBC_DEVELOPERPORTAL_USERNAME: keboola+RunnerConfigTestCI
KBC_DEVELOPERPORTAL_PASSWORD: '${{ secrets.KBC_DEVELOPERPORTAL_PASSWORD }}'
DOCKERHUB_USER: keboolabot
DOCKERHUB_TOKEN: '${{ secrets.DOCKERHUB_TOKEN }}'
KBC_STORAGE_TOKEN: '${{ secrets.KBC_STORAGE_TOKEN }}'
KBC_TEST_PROJECT_URL: ''
KBC_TEST_PROJECT_CONFIGS: ''
jobs:
build:
runs-on: ubuntu-latest
outputs:
app_image_tag: '${{ steps.tag.outputs.app_image_tag }}'
is_semantic_tag: '${{ steps.tag.outputs.is_semantic_tag }}'
steps:
-
name: 'Check out the repo'
uses: actions/checkout@v3
-
name: 'Print Docker version'
run: 'docker -v'
-
name: 'Docker login'
if: env.DOCKERHUB_TOKEN
run: 'docker login --username "$DOCKERHUB_USER" --password "$DOCKERHUB_TOKEN"'
-
name: 'Build image'
run: 'docker build -t $APP_IMAGE .'
-
name: 'Set image tag'
id: tag
run: |
TAG="${GITHUB_REF##*/}"
IS_SEMANTIC_TAG=$(echo "$TAG" | grep -q '^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$' && echo true || echo false)
echo "Tag = '$TAG', is semantic tag = '$IS_SEMANTIC_TAG'"
echo "is_semantic_tag=$IS_SEMANTIC_TAG" >> $GITHUB_OUTPUT
echo "app_image_tag=$TAG" >> $GITHUB_OUTPUT
-
name: 'Push image to ECR'
uses: keboola/action-push-to-ecr@master
with:
vendor: '${{ env.KBC_DEVELOPERPORTAL_VENDOR }}'
app_id: '${{ env.KBC_DEVELOPERPORTAL_APP }}'
username: '${{ env.KBC_DEVELOPERPORTAL_USERNAME }}'
password: '${{ env.KBC_DEVELOPERPORTAL_PASSWORD }}'
tag: '${{ steps.tag.outputs.app_image_tag }}'
push_latest: '${{ steps.tag.outputs.is_semantic_tag }}'
source_image: '${{ env.APP_IMAGE}}'
tests:
needs: build
runs-on: ubuntu-latest
steps:
-
name: 'Check out the repo'
uses: actions/checkout@v3
-
name: 'Pull image from ECR'
uses: keboola/action-pull-from-ecr@master
with:
vendor: '${{ env.KBC_DEVELOPERPORTAL_VENDOR }}'
app_id: '${{ env.KBC_DEVELOPERPORTAL_APP }}'
username: '${{ env.KBC_DEVELOPERPORTAL_USERNAME }}'
password: '${{ env.KBC_DEVELOPERPORTAL_PASSWORD }}'
tag: '${{ needs.build.outputs.app_image_tag }}'
target_image: '${{ env.APP_IMAGE}}'
tag_as_latest: true
-
name: 'Run tests'
run: |
docker run \
-e QUEUE_API_URL \
-e STORAGE_TOKEN \
${{env.APP_IMAGE}} composer ci
env:
QUEUE_API_URL: '${{ secrets.QUEUE_API_URL }}'
STORAGE_TOKEN: '${{ secrets.KBC_STORAGE_TOKEN }}'
tests-in-kbc:
needs: build
runs-on: ubuntu-latest
steps:
-
name: 'Run KBC test jobs'
if: 'env.KBC_STORAGE_TOKEN && env.KBC_TEST_PROJECT_CONFIGS'
uses: keboola/action-run-configs-parallel@master
with:
token: '${{ env.KBC_STORAGE_TOKEN }}'
componentId: '${{ env.KBC_DEVELOPERPORTAL_APP }}'
tag: '${{ needs.build.outputs.app_image_tag }}'
configs: '${{ env.KBC_TEST_PROJECT_CONFIGS }}'
deploy:
needs:
- build
- tests
- tests-in-kbc
runs-on: ubuntu-latest
if: 'startsWith(github.ref, ''refs/tags/'') && needs.build.outputs.is_semantic_tag == ''true'''
steps:
-
name: 'Set tag in the Developer Portal (main component)'
uses: keboola/action-set-tag-developer-portal@master
with:
vendor: '${{ env.KBC_DEVELOPERPORTAL_VENDOR }}'
app_id: '${{ env.KBC_DEVELOPERPORTAL_APP }}'
username: '${{ env.KBC_DEVELOPERPORTAL_USERNAME }}'
password: '${{ env.KBC_DEVELOPERPORTAL_PASSWORD }}'
tag: '${{ needs.build.outputs.app_image_tag }}'
-
name: 'Set tag in the Developer Portal (GELF variant)'
uses: keboola/action-set-tag-developer-portal@master
with:
vendor: '${{ env.KBC_DEVELOPERPORTAL_VENDOR }}'
app_id: keboola.runner-config-test-gelf
username: '${{ env.KBC_DEVELOPERPORTAL_USERNAME }}'
password: '${{ env.KBC_DEVELOPERPORTAL_PASSWORD }}'
tag: '${{ needs.build.outputs.app_image_tag }}'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli
FROM php:8.5-cli-trixie
Comment thread
ErikZigo marked this conversation as resolved.

ARG COMPOSER_FLAGS="--prefer-dist --no-interaction"
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# runner-config-test

[![Build Status](https://travis-ci.com/keboola/runner-config-test.svg?branch=master)](https://travis-ci.com/keboola/runner-config-test)
[![GitHub Actions](https://github.com/keboola/runner-config-test/actions/workflows/push.yml/badge.svg)](https://github.com/keboola/runner-config-test/actions/workflows/push.yml)

Component for testing Runner configuration interactions.
> :warning: This component is not for production use, it is deployed only to testing.
Expand Down Expand Up @@ -65,7 +65,7 @@ Clone this repository.
Run the test suite using this command:

```
docker-compose run --rm dev composer tests
docker compose run --rm dev composer tests
```

# Integration
Expand Down
51 changes: 0 additions & 51 deletions azure-pipelines.yml

This file was deleted.

8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"description": "Component for testing Job Queue services",
"license": "MIT",
"require": {
"php": "^8.1",
"php": "^8.5",
"ext-json": "*",
"graylog2/gelf-php": "^1.7",
"keboola/job-queue-api-php-client": "^2.1",
"keboola/php-component": "9.3",
"monolog/monolog": "^2.3",
"keboola/job-queue-api-php-client": "^5.0",
"keboola/php-component": "^11.0",
"monolog/monolog": "^3.0",
"phpstan/phpstan-phpunit": "^1.1",
"symfony/finder": "^6.1"
},
Expand Down
Loading
Loading