Skip to content

Mutation

Mutation #388

Workflow file for this run

name: Mutation
on:
create:
tags:
- v*
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: '44 16 * * *' # Run mutation tests every day at 16:44 UTC.
# Time chosen randomly.
permissions: {}
jobs:
psalm:
name: Infection on PHP ${{ matrix.php-versions }}
runs-on: ${{ matrix.operating-system }}
permissions:
contents: read
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.4']
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
if: matrix.ext-pqcrypto
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # nightly
with:
toolchain: nightly
components: rustfmt
- name: Setup PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
- name: Build and install ext-pqcrypto
shell: bash
run: |
git clone --depth 1 https://github.com/paragonie/ext-pqcrypto.git "$RUNNER_TEMP/ext-pqcrypto"
cd "$RUNNER_TEMP/ext-pqcrypto"
cargo build --release
EXT_DIR="$(php -r "echo ini_get('extension_dir');")"
if [[ "$RUNNER_OS" == "Windows" ]]; then
cp target/release/pqcrypto.dll "$EXT_DIR/pqcrypto.dll"
else
sudo cp target/release/libpqcrypto.so "$EXT_DIR/pqcrypto.so"
fi
echo "extension=pqcrypto" >> "$(php -r "echo php_ini_loaded_file();")"
php -m | grep pqcrypto
- name: Add Infection as dependency
run: composer require --dev infection/infection
- name: Update dependencies
run: composer update
- name: Mutation Tests
run: vendor/bin/infection
- name: Print the mutation.log file for easy copy/paste from GitHub Actions
run: cat infection.log