Skip to content

Commit

Permalink
Merge pull request #312 from ember-nexus/github-issue/297
Browse files Browse the repository at this point in the history
GitHub issue/297
  • Loading branch information
Syndesi authored May 11, 2024
2 parents 2e88a66 + 37661b6 commit 547affe
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 11 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image - AMD
- name: Build Docker image - AMD dev
run: |
docker build \
--target development \
Expand All @@ -46,11 +46,25 @@ jobs:
-f ./docker/Dockerfile \
.
docker save api:dev-amd | gzip > api-dev-amd.tar.gz
- name: Build Docker image - AMD prod
run: |
docker build \
--target production \
--build-arg="VERSION=$( cat composer.json | jq -r .version )" \
-t api:prod-amd \
-f ./docker/Dockerfile \
.
docker save api:prod-amd | gzip > api-prod-amd.tar.gz
- uses: actions/upload-artifact@v4
with:
name: docker-image-api-dev-amd
path: api-dev-amd.tar.gz
retention-days: 7
- uses: actions/upload-artifact@v4
with:
name: docker-image-api-prod-amd
path: api-prod-amd.tar.gz
retention-days: 7

cs-lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -186,6 +200,10 @@ jobs:
with:
name: docker-image-api-dev-amd
path: /tmp/docker
- uses: actions/download-artifact@v4
with:
name: docker-image-api-prod-amd
path: /tmp/docker
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -195,11 +213,12 @@ jobs:
run: |
chmod 777 ./bin/test-feature-prepare
docker load < /tmp/docker/api-dev-amd.tar.gz
docker load < /tmp/docker/api-prod-amd.tar.gz
docker compose -f ./tests/FeatureTests/docker-compose-${{ matrix.dockerCompose }}.yml up --quiet-pull -d
echo "waiting for containers to star tup (10s)"
sleep 10
echo "finished waiting"
docker exec ember-nexus-api bash -c "composer install --ignore-platform-req=php --quiet && composer test:feature && composer test:feature:deprecated"
docker exec ember-nexus-api-dev bash -c "export API_DOMAIN=\"http://ember-nexus-api-prod\" && echo \$API_DOMAIN && composer install --ignore-platform-req=php --quiet && composer test:feature && composer test:feature:deprecated"
test-example-generation-controller:
runs-on: buildjet-2vcpu-ubuntu-2204
Expand All @@ -219,6 +238,10 @@ jobs:
with:
name: docker-image-api-dev-amd
path: /tmp/docker
- uses: actions/download-artifact@v4
with:
name: docker-image-api-prod-amd
path: /tmp/docker
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -228,11 +251,12 @@ jobs:
run: |
chmod 777 ./bin/test-feature-prepare
docker load < /tmp/docker/api-dev-amd.tar.gz
docker load < /tmp/docker/api-prod-amd.tar.gz
docker compose -f ./tests/ExampleGenerationController/docker-compose.yml up --quiet-pull -d
echo "waiting for containers to star tup (10s)"
sleep 10
echo "finished waiting"
docker exec ember-nexus-api bash -c "composer install --ignore-platform-req=php --quiet && composer test:example-generation-controller && composer test:example-generation-controller:deprecated"
docker exec ember-nexus-api-dev bash -c "export API_DOMAIN=\"http://ember-nexus-api\" && echo \$API_DOMAIN && composer install --ignore-platform-req=php --quiet && composer test:example-generation-controller && composer test:example-generation-controller:deprecated"
test-example-generation-command:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Server exceptions with the HTTP status code 500 will now always log their message.
- Upgrade PHP to 8.3.7, closes #310.
- Update PHP dependencies, related to #310.
- Feature tests use production docker build in CI, closes #297.

## 0.1.6 - 2024-04-22
### Added
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "dev",
"version": "0.1.6",
"pageSize": {
"min": 5,
"default": 25,
Expand Down
11 changes: 10 additions & 1 deletion tests/ExampleGenerationController/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
services:

ember-nexus-api-dev:
container_name: ember-nexus-api-dev
image: api:dev-amd
expose:
- "80"
volumes:
- ../../:/var/www/html
- ./well-known-security.txt:/well-known-security.txt

ember-nexus-api:
container_name: ember-nexus-api
image: api:dev-amd
image: api:prod-amd
expose:
- "80"
volumes:
Expand Down
13 changes: 11 additions & 2 deletions tests/FeatureTests/docker-compose-neo4j-5.14.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
services:

ember-nexus-api:
container_name: ember-nexus-api
ember-nexus-api-dev:
container_name: ember-nexus-api-dev
image: api:dev-amd
expose:
- "80"
volumes:
- ../../:/var/www/html
- ./well-known-security.txt:/well-known-security.txt

ember-nexus-api-prod:
container_name: ember-nexus-api-prod
image: api:prod-amd
expose:
- "80"
volumes:
- ../../:/var/www/html
- ./well-known-security.txt:/well-known-security.txt

ember-nexus-neo4j:
container_name: ember-nexus-neo4j
image: neo4j:5.14
Expand Down
13 changes: 11 additions & 2 deletions tests/FeatureTests/docker-compose-neo4j-5.15.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
services:

ember-nexus-api:
container_name: ember-nexus-api
ember-nexus-api-dev:
container_name: ember-nexus-api-dev
image: api:dev-amd
expose:
- "80"
volumes:
- ../../:/var/www/html
- ./well-known-security.txt:/well-known-security.txt

ember-nexus-api-prod:
container_name: ember-nexus-api-prod
image: api:prod-amd
expose:
- "80"
volumes:
- ../../:/var/www/html
- ./well-known-security.txt:/well-known-security.txt

ember-nexus-neo4j:
container_name: ember-nexus-neo4j
image: neo4j:5.15
Expand Down
13 changes: 11 additions & 2 deletions tests/FeatureTests/docker-compose-neo4j-5.7.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
services:

ember-nexus-api:
container_name: ember-nexus-api
ember-nexus-api-dev:
container_name: ember-nexus-api-dev
image: api:dev-amd
expose:
- "80"
volumes:
- ../../:/var/www/html
- ./well-known-security.txt:/well-known-security.txt

ember-nexus-api-prod:
container_name: ember-nexus-api-prod
image: api:prod-amd
expose:
- "80"
volumes:
- ../../:/var/www/html
- ./well-known-security.txt:/well-known-security.txt

ember-nexus-neo4j:
container_name: ember-nexus-neo4j
image: neo4j:5.7
Expand Down

0 comments on commit 547affe

Please sign in to comment.