Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate travis github actions #571

Merged
merged 2 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, due to the cgroups v1 issue see the fix of @quartje at 3794e8c


steps:

Expand Down
141 changes: 83 additions & 58 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,89 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why run the tests on the old Ubuntu LTS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

timeout-minutes: 30
env:
DOCKER_COMPOSE: docker-compose -f docker-compose.yml -f docker-compose-ci.yml
DOCKER_COMPOSE_PHP_FPM: docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm
DOCKER_COMPOSE_OPENCONEXT: docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T openconext
DOCKER_COMPOSE_CYPRESS: docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T cypress

steps:

- name: Check out the repo
uses: actions/checkout@v2

- name: Start the docker images for Cypress testing
run: docker-compose -f docker-compose.yml -f docker-compose-ci.yml up -d

- name: Import the certificate on the Cypress docker machine
run: docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T cypress sh /e2e/docker/conf/cypress_import_cert.sh

- name: Run composer
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm /usr/local/bin/composer install -n --prefer-dist -o --ignore-platform-reqs
env:
SYMFONY_ENV: dev

- name: Run yarn
run: |
docker run -v ${PWD}:/var/www/html -w /var/www/html node:14 yarn install
env:
SYMFONY_ENV: dev

- name: Create front end dependencies (yarn encore production)
run: |
docker run -v ${PWD}:/var/www/html -w /var/www/html node:14 yarn run encore production
env:
SYMFONY_ENV: dev

- name: Get the database up and running
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm bin/console doctrine:migrations:migrate
env:
SYMFONY_ENV: dev

- name: Remove leftover files
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm /bin/rm -rf /tmp/sp-dashboard/ /tmp/sp-dashboard-sessions/

- name: Make the log and cache dir writable
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm chmod 777 /var/www/html/var/{logs,cache}

- name: Copy parameters.yml.dist to parameters.yml
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm cp /var/www/html/app/config/parameters.yml.dist /var/www/html/app/config/parameters.yml

- name: Wait until the spdashboard is accessable
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T openconext sh /usr/local/sbin/spdup.sh

- name: Disable Symfony debug mode
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm sed -i s/\'dev\',\ true/\'dev\',\ false/g /var/www/html/web/app_dev.php

- name: Run cypress tests
run: docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T cypress cypress run --browser chrome
continue-on-error: true

- name: Check out the repo
uses: actions/checkout@v2

- name: Start the docker images for Cypress testing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I think you can broaden the name, as we no longer solely run Cypress tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctamente

run: ${DOCKER_COMPOSE} up -d

- name: Import the certificate on the Cypress docker machine
run: ${DOCKER_COMPOSE_CYPRESS} sh /e2e/docker/conf/cypress_import_cert.sh

- name: Run composer
run: |
${DOCKER_COMPOSE_PHP_FPM} /usr/local/bin/composer install -n --prefer-dist -o --ignore-platform-reqs
env:
SYMFONY_ENV: dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we run the application in test or even prod? That might be better than dev


- name: Run yarn
run: |
docker run -v ${PWD}:/var/www/html -w /var/www/html node:14 yarn install
env:
SYMFONY_ENV: dev

- name: Create front end dependencies (yarn encore production)
run: |
docker run -v ${PWD}:/var/www/html -w /var/www/html node:14 yarn run encore production
env:
SYMFONY_ENV: dev

- name: Get the database up and running
run: |
${DOCKER_COMPOSE_PHP_FPM} bin/console doctrine:migrations:migrate
env:
SYMFONY_ENV: dev

- name: Remove leftover files
run: |
${DOCKER_COMPOSE_PHP_FPM} /bin/rm -rf /tmp/sp-dashboard/ /tmp/sp-dashboard-sessions/

- name: Make the log and cache dir writable
run: |
${DOCKER_COMPOSE_PHP_FPM} chmod 777 /var/www/html/var/{logs,cache}

- name: Copy parameters.yml.dist to parameters.yml
run: |
${DOCKER_COMPOSE_PHP_FPM} cp /var/www/html/app/config/parameters.yml.dist /var/www/html/app/config/parameters.yml

- name: Wait until the spdashboard is accessable
run: |
${DOCKER_COMPOSE_OPENCONEXT} sh /usr/local/sbin/spdup.sh

- name: Disable Symfony debug mode
run: |
${DOCKER_COMPOSE_PHP_FPM} sh -c 'composer disabledebug'

- name: Run Copy Paste Detector
run: |
${DOCKER_COMPOSE_PHP_FPM} sh -c 'composer jscpd'
continue-on-error: true

- name: Run CI tests
run: |
${DOCKER_COMPOSE_PHP_FPM} sh -c 'composer check'
Comment on lines +75 to +82
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say: make the jscpd part of the composer check (Run CI tests)

Copy link
Contributor Author

@Shaky212 Shaky212 Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have deliberately chosen to keep it out of the CI tests for now, otherwise it breaks the CI tests. Or is there a way to continue anyway?


- name: Run Audit
run: |
${DOCKER_COMPOSE_PHP_FPM} sh -c 'composer yarn-audit'
continue-on-error: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm skeptical as to allow a failing yarn/composer audit.. I thik you should remove this continue-on-error..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes..., but a lot of critical and high risk vulnerabilities found, that need to be fixed in the end, I guess (during upgrade SF?)


- name: Run Cypress tests
run: |
${DOCKER_COMPOSE_PHP_FPM} sh -c 'composer cypress'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this run on the cypress container? It now errors without running a Cypress test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that may be the case.

continue-on-error: true

- name: Run translations
run: |
${DOCKER_COMPOSE_PHP_FPM} sh -c 'composer translations'

47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

175 changes: 0 additions & 175 deletions build.xml

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions ci/qa/attrdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
# attributes data check

cd $(dirname $0)/../../

# https://www.npmjs.com/package/ajv-cli
./node_modules/.bin/ajv validate -s app/Resources/schemas/attributes.scheme.json -d app/config/attributes.json
7 changes: 7 additions & 0 deletions ci/qa/attrsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
# attributes scheme check

cd $(dirname $0)/../../

# https://www.npmjs.com/package/ajv-cli
./node_modules/.bin/ajv compile -s app/Resources/schemas/attributes.scheme.json
Loading