In the tests, sleep a bit before removing temp files, as AV scanner m… #263
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
| name: CI in Docker container | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'testme.tmp.pl' | |
| pull_request: | |
| paths-ignore: | |
| - 'testme.tmp.pl' | |
| workflow_dispatch: | |
| # schedule: | |
| # - cron: '42 5 * * *' | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| perl: [ '5.30', '5.36', '5.40', 'latest' ] | |
| postgres: [ '11', '13', '15', '17', 'latest' ] | |
| compiler: [ 'gcc' ] | |
| include: | |
| # Add extra jobs for building with clang | |
| - perl: 'latest' | |
| postgres: 'latest' | |
| compiler: 'clang' | |
| - perl: '5.40' | |
| postgres: '15' | |
| compiler: 'clang' | |
| services: | |
| postgreshost: | |
| image: postgres:${{matrix.postgres}} | |
| env: | |
| POSTGRES_USER: test_user | |
| POSTGRES_PASSWORD: test_secret | |
| POSTGRES_DB: test_db | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| runs-on: ubuntu-latest | |
| container: perl:${{ matrix.perl }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Show Perl Version | |
| run: | | |
| perl -v | |
| - name: Install non-perl dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y libaspell-dev | |
| if [ "${{ matrix.compiler }}" = "clang" ]; then apt-get install -y clang; fi | |
| - name: Install Modules | |
| run: | | |
| cpanm -v | |
| cpanm --installdeps --notest . | |
| cpanm --notest Perl::Critic Text::SpellChecker | |
| - name: Show Errors on Ubuntu | |
| if: ${{ failure() && startsWith( matrix.runner, 'ubuntu-')}} | |
| run: | | |
| cat /home/runner/.cpanm/work/*/build.log | |
| - name: Run make | |
| run: | | |
| # Conditionally override the compiler for ExtUtils::MakeMaker | |
| if [ "${{ matrix.compiler }}" = "clang" ]; then | |
| clang --version | |
| perl Makefile.PL CC=clang LD=clang OPTIMIZE="$(perl -MConfig -e 'print $Config{optimize}') -Werror" | |
| else | |
| gcc --version | |
| perl Makefile.PL OPTIMIZE="$(perl -MConfig -e 'print $Config{optimize}') -Werror" | |
| fi | |
| make | |
| - name: Run tests | |
| env: | |
| AUTHOR_TESTING: 1 | |
| RELEASE_TESTING: 1 | |
| DBI_DSN: "dbi:Pg:dbname=test_db;host=postgreshost" | |
| DBI_PASS: test_secret | |
| DBI_USER: test_user | |
| run: | | |
| make test |