In order to test changes to the game, you need to be able to copy the code out of our GitHub repository and into a personal BGA project and then back again.
InnovationJohnSmith
).git clone https://github.com/micahstairs/bga-innovation.git innovation
). You'll make your life easier if the directory is named innovation
instead of bga-innovation
.git clone https://github.com/elaskavaia/bga-sharedcode.git
).Once the project is checked out, run composer install
to pull the dependencies (mainly for unit testing).
In order to submit changes to this repository you will need to eventually submit a pull request with your changes. This means you need to have your own local branch. Before running the following commands, make sure you are on the branch of this repository that you want to diverge from (e.g. main-dev
) and that you have called git pull
so that you have the latest changes.
git branch johnsmith
git checkout johnsmith
Use the bgaprojectrename.php
script from the https://github.com/elaskavaia/bga-sharedcode repository you cloned. For example, if your BGA project is named InnovationJohnSmith
, you would call a command like:
php bga-sharedcode/misc/bgaprojectrename.php innovation innovationjohnsmith
WARNING: In order for the script to work correctly, the directory containing our repository should be named innovation
not bga-innovation
.
After using the bgaprojectrename.php
script, check the innovationjohnsmith.action.php
file and make sure the file contains class action_innovationjohnsmith extends APP_GameAction
instead of class action_innovationjohnsmithjohnsmith extends APP_GameAction
. If the name of the action class is wrong, then when you start a game you will just see a blank white screen.
Make all of your changes in this other directory (e.g. innovationjohnsmith
), testing them on https://studio.boardgamearena.com/ by pushing them to your BGA project. This can be accomplished by using the SFTP extension in VSCode.
After you've tested your changes, copy the changes back to your local branch in our repository.
php bga-sharedcode/misc/bgaprojectrename.php innovationjohnsmith innovation
Push your local branch into the GitHub repository.
git push -u origin johnsmith
Then navigate to https://github.com/micahstairs/bga-innovation/pulls, click "New pull request", and follow the prompts there.
sftp.json
by using the command shortuct Ctrl+Shift+P
and running SFTP: config
. Paste the following, replacing johnsmith
and password
(SFTP password, not BoardGameArena password) as appropriate.
{
"name": "BGA",
"host": "1.studio.boardgamearena.com",
"protocol": "sftp",
"port": 22,
"username": "johnsmith",
"password": "password",
"remotePath": "/innovationjohnsmith/",
"uploadOnSave": true,
"ignore": [
".vscode",
".git",
".github",
".DS_Store",
".phpunit.result.cache",
"misc/",
"node_modules",
"package-lock.json",
"vendor/",
"composer.json",
"composer.lock",
"phpunit.xml",
"tests/"
],
"syncOption": {
"skipCreate": false,
"delete": true
}
}
Ctrl+Shift+P
and runing SFTP: Sync Local -> Remote
"agent": "$SSH_AUTH_SOCK"
or directly linking the relevant private key path, "privateKeyPath": "/path/to/private/ssh/key"
"runOnSave.commands": [
{
"match": ".*\\.scss$",
"notMatch": "variables.scss$",
"command": "sass ${file} ${fileDirname}/${fileBasenameNoExtension}.css",
"runIn": "backend",
"runningStatusMessage": "Compiling ${fileBasename}",
"finishStatusMessage": "${fileBasename} compiled"
}
]
We use phpunit for testing, and you can view those tests in the tests/
folder.
To run the tests, simply run: ./vendor/bin/phpunit