This commit is contained in:
Robin Appelman 2025-07-07 17:57:45 +02:00
commit a7fb16671a
2 changed files with 34 additions and 35 deletions

View file

@ -1,22 +1,27 @@
# SPDX-FileCopyrightText: 2021 Robin Appelman <robin@icewind.nl> # SPDX-FileCopyrightText: 2021 Robin Appelman <robin@icewind.nl>
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
on: [push, pull_request] on:
pull_request:
push:
branches:
- main
- master
name: CI name: CI
jobs: jobs:
php-cs-fixer: php-cs-fixer:
name: PHP-CS-Fixer name: PHP-CS-Fixer
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: https://github.com/shivammathur/setup-php@v2
with: with:
php-version: '8.0' php-version: '8.0'
extensions: apcu extensions: apcu
- name: PHP-CS-Fixer - name: PHP-CS-Fixer
uses: OskarStark/php-cs-fixer-ga@2.16.7 uses: https://github.com/OskarStark/php-cs-fixer-ga@2.16.7
with: with:
args: --diff --dry-run --allow-risky yes --stop-on-violation --using-cache=no --path-mode=intersection args: --diff --dry-run --allow-risky yes --stop-on-violation --using-cache=no --path-mode=intersection
@ -47,9 +52,6 @@ jobs:
ACCOUNT_test: test ACCOUNT_test: test
UID_test: 1000 UID_test: 1000
SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes" SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes"
ports:
- 139:139
- 445:445
steps: steps:
- name: Install packages - name: Install packages
@ -57,7 +59,7 @@ jobs:
sudo apt-get install smbclient libsmbclient-dev sudo apt-get install smbclient libsmbclient-dev
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: https://github.com/shivammathur/setup-php@v2
with: with:
php-version: "${{ matrix.php-version }}" php-version: "${{ matrix.php-version }}"
extensions: apcu, smbclient extensions: apcu, smbclient
@ -66,9 +68,11 @@ jobs:
run: composer install run: composer install
- name: Config - name: Config
run: | run: |
echo '{"host": "localhost","user": "test","password": "test","share": "test","root": ""}' > tests/config.json IP=$(docker inspect ${{ job.services.samba.id }} | jq -r 'map(.NetworkSettings.Networks)[0] | .[].IPAddress')
echo "Samba running at $IP"
echo '{"host": "'$IP'","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
- name: PHPUnit Tests - name: PHPUnit Tests
uses: nick-invision/retry@v2 uses: https://github.com/nick-invision/retry@v2
with: with:
timeout_minutes: 2 timeout_minutes: 2
max_attempts: 3 max_attempts: 3
@ -76,7 +80,7 @@ jobs:
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml --coverage-clover=coverage.xml command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml --coverage-clover=coverage.xml
env: env:
BACKEND: ${{ matrix.backend }} BACKEND: ${{ matrix.backend }}
- uses: codecov/codecov-action@v3 - uses: https://github.com/codecov/codecov-action@v3
with: with:
files: ./coverage.xml files: ./coverage.xml
@ -109,9 +113,6 @@ jobs:
ACCOUNT_test: test ACCOUNT_test: test
UID_test: 1000 UID_test: 1000
SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes" SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes"
ports:
- 139:139
- 445:445
steps: steps:
- name: Setup smbclient - name: Setup smbclient
@ -123,7 +124,7 @@ jobs:
sudo chmod +x /usr/local/bin/smbclient sudo chmod +x /usr/local/bin/smbclient
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: https://github.com/shivammathur/setup-php@v2
with: with:
php-version: 8.0 php-version: 8.0
extensions: apcu, smbclient extensions: apcu, smbclient
@ -132,9 +133,11 @@ jobs:
run: composer install run: composer install
- name: Config - name: Config
run: | run: |
echo '{"host": "localhost","user": "test","password": "test","share": "test","root": ""}' > tests/config.json IP=$(docker inspect ${{ job.services.samba.id }} | jq -r 'map(.NetworkSettings.Networks)[0] | .[].IPAddress')
echo "Samba running at $IP"
echo '{"host": "'$IP'","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
- name: PHPUnit Tests - name: PHPUnit Tests
uses: nick-invision/retry@v2 uses: https://github.com/nick-invision/retry@v2
with: with:
timeout_minutes: 2 timeout_minutes: 2
max_attempts: 3 max_attempts: 3
@ -142,12 +145,12 @@ jobs:
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml --coverage-clover=coverage.xml command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml --coverage-clover=coverage.xml
env: env:
BACKEND: smbclient BACKEND: smbclient
- uses: codecov/codecov-action@v3 - uses: https://github.com/codecov/codecov-action@v3
with: with:
files: ./coverage.xml files: ./coverage.xml
alpine-test: alpine-test:
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
name: Unit tests (alpine) name: Unit tests (alpine)
services: services:
@ -157,14 +160,11 @@ jobs:
ACCOUNT_test: test ACCOUNT_test: test
UID_test: 1000 UID_test: 1000
SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes" SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes"
ports:
- 139:139
- 445:445
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: https://github.com/shivammathur/setup-php@v2
with: with:
php-version: 8.0 php-version: 8.0
- name: Composer - name: Composer
@ -174,20 +174,18 @@ jobs:
docker pull icewind1991/smbclient-php-alpine docker pull icewind1991/smbclient-php-alpine
- name: Config - name: Config
run: | run: |
echo '{"host": "localhost","user": "test","password": "test","share": "test","root": ""}' > tests/config.json IP=$(docker inspect ${{ job.services.samba.id }} | jq -r 'map(.NetworkSettings.Networks)[0] | .[].IPAddress')
echo "Samba running at $IP"
echo '{"host": "'$IP'","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
- name: PHPUnit Tests - name: PHPUnit Tests
run: | run: |
docker run --network "host" --rm -v $PWD:/smb icewind1991/smbclient-php-alpine /smb/vendor/bin/phpunit -c /smb/tests/phpunit.xml /smb/tests docker run --network "host" --rm -v $PWD:/smb icewind1991/smbclient-php-alpine /smb/vendor/bin/phpunit -c /smb/tests/phpunit.xml /smb/tests
kerberos-sso: kerberos-sso:
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
name: Kerberos SSO tests name: Kerberos SSO tests
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
- name: Composer - name: Composer
run: composer install run: composer install
- name: Pull images - name: Pull images
@ -212,7 +210,7 @@ jobs:
docker logs apache docker logs apache
static-psalm-analysis: static-psalm-analysis:
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
name: Psalm static analysis name: Psalm static analysis
strategy: strategy:
@ -226,6 +224,7 @@ jobs:
- "8.1" - "8.1"
- "8.2" - "8.2"
- "8.3" - "8.3"
- "8.4"
steps: steps:
- name: krb5-dev - name: krb5-dev
@ -233,7 +232,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up php - name: Set up php
uses: shivammathur/setup-php@master uses: https://github.com/shivammathur/setup-php@master
with: with:
php-version: "${{ matrix.php-version }}" php-version: "${{ matrix.php-version }}"
tools: composer:v2 tools: composer:v2
@ -248,14 +247,14 @@ jobs:
phpstan: phpstan:
name: PHPStan Static Analysis name: PHPStan Static Analysis
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- name: krb5-dev - name: krb5-dev
run: sudo apt-get install -y libkrb5-dev run: sudo apt-get install -y libkrb5-dev
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: https://github.com/shivammathur/setup-php@v2
with: with:
php-version: '8.0' php-version: '8.0'
extensions: apcu, smbclient, krb5 extensions: apcu, smbclient, krb5

View file

@ -10,6 +10,6 @@ jobs:
reuse-compliance-check: reuse-compliance-check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - uses: https://github.com/actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: REUSE Compliance Check - name: REUSE Compliance Check
uses: fsfe/reuse-action@a46482ca367aef4454a87620aa37c2be4b2f8106 # v3.0.0 uses: https://github.com/fsfe/reuse-action@a46482ca367aef4454a87620aa37c2be4b2f8106 # v3.0.0