Skip to content

Update nixpkgs to 23.05 #39

Update nixpkgs to 23.05

Update nixpkgs to 23.05 #39

Workflow file for this run

name: ci
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
name: "Lint | PHP ${{ matrix.php-version }}"
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
- name: Validate composer.json and composer.lock
run: composer validate
# The package "stephank/composer-plugin-nixify" is pointing to a commit-ref, this is bad practice and can cause unforeseen issues.
# run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: phpcs
run: php vendor/bin/phpcs
- name: phpstan
run: php vendor/bin/phpstan analyze
test:
runs-on: ubuntu-latest
name: "Test | PHP ${{ matrix.php-version }}"
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run test suite
run: php vendor/bin/phpunit
coverage:
runs-on: ubuntu-latest
name: "Coverage | PHP ${{ matrix.php-version }}"
strategy:
matrix:
php-version:
- "8.2"
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: pcov
php-version: "${{ matrix.php-version }}"
tools: composer:v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run test suite with coverage
run: php vendor/bin/phpunit --coverage-text
- name: Upload code coverage
# https://github.com/paambaati/codeclimate-action/issues/638#issuecomment-1363476627
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: 3f8f6d064fc0b063230c71511f07aec326a2eb84f3c5653161b5f087aae315f9
with:
coverageCommand: "true"
coverageLocations: |
clover.xml:clover
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-22.11
- run: nix build -L
- run: nix flake check -L