chore: release v0.2.1 #21
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 | |
| with: | |
| toolchain: nightly | |
| components: clippy | |
| - run: cargo clippy --release -- -D warnings | |
| rust-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 | |
| with: | |
| toolchain: stable | |
| - run: cargo test | |
| php-tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] | |
| name: PHP ${{ matrix.php-version }} on ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - uses: shivammathur/setup-php@fcafdd6392932010c2bd5094439b8e33be2a8a09 # v2.37.0 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| tools: composer | |
| - name: Set rustfmt for bindgen (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| rustup component add rustfmt | |
| $rustfmt = & rustup which rustfmt | |
| echo "RUSTFMT=$rustfmt" >> $env:GITHUB_ENV | |
| - run: composer install --no-interaction | |
| - run: cargo build --release | |
| - name: Run PHPUnit (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| EXT=$(pwd)/target/release/libpqcrypto.so | |
| php -d "extension=${EXT}" vendor/bin/phpunit | |
| - name: Run PHPUnit (Windows) | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| EXT_DIR="$(php -r "echo ini_get('extension_dir');")" | |
| cp target/release/pqcrypto.dll "${EXT_DIR}/pqcrypto.dll" | |
| echo "extension=pqcrypto" >> "$(php -r "echo php_ini_loaded_file();")" | |
| php -m | grep pqcrypto | |
| php vendor/bin/phpunit |