File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed
Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1- name : Create Release
1+ name : Test and Create Release
22
33on :
44 push :
5- tags :
6- - ' v*'
7- # Allows you to run this workflow manually from the Actions tab
85 workflow_dispatch :
96
107env :
11- DATA_DIR : cypress/yaml
8+ DATA_DIR : ' cypress/yaml'
129 CYPRESS_BASE_URL : " http://localhost:8181"
1310
1411jobs :
2522 node-version : 23
2623 - run : npm ci
2724 - run : npm run build --if-present
25+ - name : PHP env check
26+ run : |
27+ php -r '
28+ $edd = $_ENV["DATA_DIR"] ?? "--nonexistent--";
29+ $gdd = getenv("DATA_DIR") ?? "--nonexistent--";
30+ echo "S_ENV variable DATA_DIR is: " . $edd . "\n";
31+ echo "getenv variable DATA_DIR is:" . $gdd . "\n";
32+ '
2833 - name : Cypress run
2934 uses : cypress-io/github-action@v6
3035 with :
Original file line number Diff line number Diff line change 1515 }
1616
1717 // finally merge from environment
18- if (!empty ($ _ENV ['DATA_DIR ' ])) {
19- $ settings ['settings ' ]['dataDir ' ] = $ _ENV ['DATA_DIR ' ];
18+ // dotenv loads .env files and env variables - in that order
19+ // using getenv() since $_ENV is not available in (at least some) GitHub runners
20+ if (!empty (getenv ('DATA_DIR ' ))) {
21+ $ settings ['settings ' ]['dataDir ' ] = getenv ('DATA_DIR ' );
2022 }
2123
2224 $ containerBuilder ->addDefinitions ($ settings );
Original file line number Diff line number Diff line change 1818 $ containerBuilder ->enableCompilation (ROOT_DIR . 'var/cache ' );
1919}
2020
21- // Load .env file
22- $ dotenv = Dotenv \Dotenv::createImmutable (ROOT_DIR );
21+ // Load .env file and env variables
22+ // unsafe because we need getenv(), $_ENV is not available in Github runners
23+ $ dotenv = Dotenv \Dotenv::createUnsafeImmutable (ROOT_DIR );
2324$ dotenv ->safeLoad ();
2425
2526// Set up settings
You can’t perform that action at this time.
0 commit comments