What is the equivalent configuration for Github Action similar function like the command below:
env-cmd -f .env cypress run --component
I tried with one env var imported into Github Action, but not working:
env:
CYPRESS_PUBLIC_PATH: /public/
So, instead of defining the env variables one by one, I prefer to load the env file and directly consumed by the application/cypress.
I can't find any documentation that will load one env file in Github Action. Or perhaps there is a way to run the exact same code above in Github Action?
Update: I followed @Maddie.Squerciati's instruction to define env file on Cypress config, it works on my local, however github actions still doesn't recognize/use the env file.
Here is my github action config:
name: Cypress
uses: cypress-io/github-action@v5
with:
config-file: cypress.config.js
command: npm run cy:run-unit
component: true
record: false
parallel: false
browser: chrome