Zero out stack frame ht #29
This file contains 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: | |
- master | |
- develop | |
- ci | |
pull_request: | |
branches: | |
- master | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: "Test | PHP ${{ matrix.php-version }}" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: "none" | |
extensions: json, opcache | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2 | |
- run: phpize | |
- run: ./configure | |
- run: make | |
- run: make test | |
coverage: | |
runs-on: ubuntu-latest | |
name: "Coverage (${{ matrix.debug }}) | PHP ${{ matrix.php-version }}" | |
strategy: | |
matrix: | |
debug: | |
- "std" | |
- "debug" | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Pkgs | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: lcov | |
version: lcov | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: pcov | |
extensions: json, opcache | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2 | |
- run: phpize | |
- run: ./configure CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}" LDFLAGS="--coverage ${LDFLAGS}" | |
if: matrix.debug == 'debug' | |
- run: ./configure --enable-vyrtue-debug CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}" LDFLAGS="--coverage ${LDFLAGS}" | |
if: matrix.debug != 'debug' | |
- run: lcov --directory . --zerocounters | |
- run: lcov --directory . --capture --compat-libtool --initial --output-file coverage.info | |
- run: make | |
- run: make test | |
- run: | | |
lcov --no-checksum --directory . --capture --compat-libtool --output-file coverage.info | |
lcov --remove coverage.info "/usr*" \ | |
--remove coverage.info "*/.phpenv/*" \ | |
--compat-libtool \ | |
--output-file coverage.info | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: coverage.info | |
format: lcov | |
parallel: true | |
finish: | |
needs: coverage | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true | |
nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Up Build Cache | |
uses: actions/cache@v4 | |
id: nix-cache | |
with: | |
path: /tmp/nix-store.nar | |
key: nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.nix', 'flake.lock') }} | |
restore-keys: nix-store.nar-${{ runner.os }}- | |
- uses: cachix/install-nix-action@v25 | |
with: | |
nix_path: nixpkgs=channel:nixos-23.11 | |
- name: Import Nix Store Cache | |
if: "steps.nix-cache.outputs.cache-hit == 'true'" | |
run: | | |
nix-store --import < /tmp/nix-store.nar | |
- name: nix build -L | |
run: | | |
nix eval .#packages --impure --raw --apply '(import ./.github/attrs.nix { prefix = ".#packages"; })' \ | |
| xargs nix build -L | |
- run: nix flake check -L | |
- name: Export Nix Store Cache | |
shell: bash | |
run: | | |
packages= | |
packages+=$(nix eval .#packages --impure --raw --apply '(import ./.github/attrs.nix { prefix = ".#packages"; })') | |
packages+=$'\n' | |
packages+=$(nix eval .#checks --impure --raw --apply '(import ./.github/attrs.nix { prefix = ".#checks"; })') | |
echo "$packages" \ | |
| xargs -I{} bash -c 'nix eval --raw {} && echo' \ | |
| grep -v pre-commit-run \ | |
| xargs nix-store -qR \ | |
| xargs nix-store --export > /tmp/nix-store.nar |