-
-
Notifications
You must be signed in to change notification settings - Fork 3
CircleCI Config with database support #4
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
Open
olback
wants to merge
28
commits into
tempfiles-download:master
Choose a base branch
from
olback:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
0d4b925
initial circle ci config
olback ea70fdc
added workflow
olback d810dbd
change server to backend
olback c0d31c6
use sudo for when installing with apt
olback ead2da3
change image to php:7 and fix mysql connect syntax
olback 2bd5ab7
specify host and port
olback 7093907
specify host and port
olback 2f2c3a6
specify protocol
olback 4891cb6
rebuild?
olback 18fc465
reformat
olback a06870e
install php-mysql, describe env vars
olback 643c45e
specify php version
olback a5afa6a
specify php version
olback 9a0bd69
db test test
olback 053e16e
change use path
olback c3f234c
log for testing
olback 67821db
remove error_log
olback 1fb1a54
removed unnecessary test step
olback 843c4f2
don't include apache
olback 941fca9
added comments
olback 4d7f744
added front end build
olback efb3bfe
fix syntax
olback 163648e
cd to frontend
olback a25d7de
removed comments
olback c33475d
Update backend/src/com/carlgo11/tempfiles/Autoload.php
olback 238fa37
Merge c33475d8efd79c55d9b58bd32c0303dd9fa6660d into 5bfbb906f617ab36b…
olback d2c6638
Allow for non MySQL phpunit tests
Carlgo11 98bdcbb
Make PHPUnit non MySQL the default config
Carlgo11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| version: 2 | ||
|
|
||
| jobs: | ||
| backend: | ||
| docker: | ||
| - image: circleci/php:7.2-stretch | ||
| environment: | ||
| ag44jc7aqs2rsup2bb6cx7utc: '127.0.0.1' # 'mysql-url' | ||
| hp7wz20wu4qfbfcmqywfai1j4: tempfiles # 'mysql-user' | ||
| mom8c5hrbn8c1r5lro1imfyax: thisisonlyusedfortestinganyways # 'mysql-password' | ||
| qb1yi60nrz3tjjjqqb7l2yqra: tempfiles # 'mysql-db' | ||
| rb421p9wniz81ttj7bdgrg0ub: tempfiles # 'mysql-table' | ||
| - image: circleci/mariadb:10-bionic-ram | ||
| environment: | ||
| MYSQL_DATABASE: tempfiles | ||
| MYSQL_USER: tempfiles | ||
| MYSQL_PASSWORD: thisisonlyusedfortestinganyways | ||
| steps: | ||
| - checkout | ||
|
|
||
| - restore_cache: | ||
| key: composer-cache-{{ checksum "backend/composer.lock" }} | ||
|
|
||
| - run: | ||
| name: Composer install | ||
| command: "cd backend && composer install" | ||
|
|
||
| - save_cache: | ||
| paths: | ||
| - backend/vendor | ||
| key: composer-cache-{{ checksum "backend/composer.lock" }} | ||
|
|
||
| - run: | ||
| name: Install PHP extensions | ||
| command: sudo docker-php-ext-install -j$(nproc) mysqli | ||
|
|
||
| - run: | ||
| name: Install MySQL Client | ||
| command: | | ||
| sudo apt update | ||
| sudo apt install -y mysql-client | ||
|
|
||
| - run: | ||
| name: Waiting for Mariadb to be ready | ||
| command: | | ||
| for i in `seq 1 10`; | ||
| do | ||
| nc -z localhost 3306 && echo Success && exit 0 | ||
| echo -n . | ||
| sleep 1 | ||
| done | ||
| echo Failed waiting for Mariadb && exit 1 | ||
|
|
||
| - run: | ||
| name: Create database & table | ||
| command: mysql --protocol=tcp --host=localhost --port=3306 --user=$hp7wz20wu4qfbfcmqywfai1j4 --password=$mom8c5hrbn8c1r5lro1imfyax < resources/install_mysql.sql | ||
|
|
||
|
|
||
| - run: | ||
| name: "Run PHP Unit Tests" | ||
| command: "cd backend && ./vendor/phpunit/phpunit/phpunit" | ||
|
|
||
| frontend: | ||
| docker: | ||
| - image: circleci/ruby:2 | ||
| steps: | ||
| - checkout | ||
|
|
||
| - restore_cache: | ||
| keys: | ||
| - gem-cache-{{ checksum "frontend/Gemfile.lock" }} | ||
|
|
||
| - run: | ||
| name: Bundle install | ||
| command: cd frontend && bundle install --path vendor/bundle | ||
|
|
||
| - save_cache: | ||
| paths: | ||
| - frontend/vendor/bundle | ||
| key: gem-cache-{{ checksum "frontend/Gemfile.lock" }} | ||
|
|
||
| - run: | ||
| name: Build frontend | ||
| command: cd frontend && bundle exec rake proof build | ||
|
|
||
| # deploy: | ||
| # machine: | ||
| # enabled: true | ||
| # steps: | ||
| # - run: | ||
| # name: Trigger Webhook | ||
| # command: # curl? | ||
|
|
||
|
|
||
|
|
||
| workflows: | ||
| version: 2 | ||
| test: | ||
| jobs: | ||
| - backend | ||
| - frontend | ||
| # - deploy: | ||
| # requires: | ||
| # - backend | ||
| # - frontend | ||
| # filters: | ||
| # branches: | ||
| # only: master |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?php | ||
|
|
||
| namespace com\carlgo11\tempfiles; | ||
|
|
||
| use com\carlgo11\tempfiles; | ||
| use PHPUnit\Framework\TestCase; | ||
|
|
||
| class DataStorageTest extends TestCase | ||
| { | ||
|
|
||
| // TODO: Remove. Just an example. | ||
| public function testGetMariaDBVersion() { | ||
| $this->assertIsString(DataStorage::getMariaDBVersion()); | ||
| } | ||
|
|
||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.