safe icon indicating copy to clipboard operation
safe copied to clipboard

more strict php requirement

Open dbrekelmans opened this issue 3 years ago • 7 comments

dbrekelmans avatar Jan 03 '22 15:01 dbrekelmans

Hi @fox91, following your PR with submodules (https://github.com/thecodingmachine/safe/pull/292), I'm targeting the 1.x branch, but for some reason the github actions are detecting changes in the generated files. I'm not sure how this is possible, do you perhaps have any idea?

dbrekelmans avatar Jan 03 '22 15:01 dbrekelmans

I think maybe the better idea would be to commit the documentation files that you want to use, otherwise a new personn won't be able to work on the branch 1.x since they won't have the same doc than you and won't generate the same files.

Since the github project of the php doc doesn't use tag, you cannot load the specific version that you want, so you need to commit everything.

The cleaner way would be to commit you doc files in separates project and then just update the script update.sh to pull from theses projects

Kharhamel avatar Jan 04 '22 16:01 Kharhamel

@Kharhamel PR #292 introduced git submodules for the doc files, pinned to a certain commit hash. So in theory, everyone should get the exact same docs (that specific commit hash)

dbrekelmans avatar Jan 04 '22 16:01 dbrekelmans

Hi @fox91, following your PR with submodules (#292), I'm targeting the 1.x branch, but for some reason the github actions are detecting changes in the generated files. I'm not sure how this is possible, do you perhaps have any idea?

Hi @dbrekelmans, I've tested branch 1.x with PHP 7.4 and I don't get difference in generated files. This is the output of PHPunit on my env (the same that is failing in CI):

PHPUnit 8.5.2 by Sebastian Bergmann and contributors.

Error:         No code coverage driver is available

...................................Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/pcre/functions/preg-match.xml
.Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/pcre/functions/preg-match.xml
.Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/pcre/functions/preg-match.xml
.Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/mbstring/functions/mb-ereg-replace-callback.xml
Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/gmp/functions/gmp-export.xml
Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/hash/functions/hash-update.xml
Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/imap/functions/imap-open.xml
.Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/apache/functions/apache-getenv.xml
.Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/array/functions/array-replace.xml
Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/shmop/functions/shmop-delete.xml
Loading /home/me/dev/safe/generator/tests/../doc/doc-en/en/reference/sqlsrv/functions/sqlsrv-next-result.xml
..................        58 / 58 (100%)

Time: 650 ms, Memory: 78.00 MB

OK (58 tests, 155 assertions)

I'm trying, but locally I don't know how to reproduce the error.

It seems that the step "Check out submodules" was skipped (maybe already cached?) but then the test can't some file:

file_get_contents(/home/runner/work/safe/safe/generator/tests/../doc/doc-en/en/reference/session/functions/session-register.xml):
  failed to open stream: No such file or directory

Maybe the action don't manage correctly the submodules cache? Can you try disabling cache for same tests?


Hi @Kharhamel, as said by @dbrekelmans git submodules are pinned to a certain commit hash, so everyone (including CI) can use exactly the same version.

fox91 avatar Jan 05 '22 14:01 fox91

@dbrekelmans try using this step on actions:

- name: Checkout repository and submodules
  uses: actions/checkout@v2
  with:
    submodules: recursive

Instead of steps "Checkout" and "Check out submodules"

or replace your git submodule init with git submodule update --init --recursive.

fox91 avatar Jan 05 '22 15:01 fox91

The CI workflow use a cache (https://github.com/actions/cache) for the documentation file which may be reused between master and 1.x. It would probably be easier to just remove the caching step on 1.x

Kharhamel avatar Jan 05 '22 17:01 Kharhamel

Hi @Kharhamel, any news about the solutions that I've suggested here?

fox91 avatar Jan 21 '22 13:01 fox91