mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
nix based phpunit
This commit is contained in:
parent
57693daa35
commit
7e87dd23e6
3 changed files with 124 additions and 132 deletions
|
|
@ -23,16 +23,16 @@ jobs:
|
|||
- run: nix flake check --keep-going
|
||||
|
||||
php-versions:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: nix
|
||||
name: Unit tests - PHP ${{ matrix.php-version }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-version:
|
||||
- "8.2"
|
||||
- "8.3"
|
||||
- "8.4"
|
||||
- "82"
|
||||
- "83"
|
||||
- "84"
|
||||
|
||||
services:
|
||||
samba:
|
||||
|
|
@ -45,138 +45,129 @@ jobs:
|
|||
no; browseable = yes"
|
||||
|
||||
steps:
|
||||
- name: Install packages
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y smbclient libsmbclient-dev
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup PHP
|
||||
uses: https://github.com/shivammathur/setup-php@v2
|
||||
- uses: https://codeberg.org/icewind/attic-action@v1
|
||||
with:
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
extensions: apcu, smbclient
|
||||
run: composer install
|
||||
name: link
|
||||
instance: https://cache.icewind.link
|
||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||
- name: Composer
|
||||
run: |
|
||||
cp -r $(nix build .#vendor --print-out-paths --no-link)/vendor vendor
|
||||
- name: Config
|
||||
run: |
|
||||
echo '{"host": "samba","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
|
||||
- name: Setup phpunit
|
||||
run: |
|
||||
nix build .#apps.x86_64-linux.phpunit${{ matrix.php-version }}.program
|
||||
- name: PHPUnit Tests - smbclient
|
||||
uses: https://github.com/nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
retry_on: timeout
|
||||
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml
|
||||
run: nix run .#phpunit${{ matrix.php-version }} -- tests -c tests/phpunit.xml
|
||||
env:
|
||||
BACKEND: smbclient
|
||||
- name: PHPUnit Tests - libsmbclient
|
||||
uses: https://github.com/nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
retry_on: timeout
|
||||
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml
|
||||
run: |
|
||||
mkdir -p /var/lock
|
||||
nix run .#phpunit${{ matrix.php-version }} -- tests -c tests/phpunit.xml
|
||||
env:
|
||||
BACKEND: libsmbclient
|
||||
|
||||
smb-versions:
|
||||
runs-on: ubuntu-22.04
|
||||
name:
|
||||
Unit tests - Samba ${{ matrix.server-version }} - smbclient ${{
|
||||
matrix.client-version }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
client-version:
|
||||
- "4.21.4"
|
||||
- "4.20.4"
|
||||
- "4.19.5"
|
||||
- "4.18.1"
|
||||
- "4.17.7"
|
||||
- "4.16.10"
|
||||
- "4.15.13"
|
||||
- "4.14.9"
|
||||
- "4.11.17"
|
||||
server-version:
|
||||
- "latest"
|
||||
- "4.9.4"
|
||||
- "4.8.5"
|
||||
|
||||
services:
|
||||
samba:
|
||||
image: "servercontainers/samba:${{ matrix.server-version }}"
|
||||
env:
|
||||
ACCOUNT_test: test
|
||||
UID_test: 1000
|
||||
SAMBA_VOLUME_CONFIG_test:
|
||||
"[test]; path=/tmp; valid users = test; guest ok = no; read only =
|
||||
no; browseable = yes"
|
||||
|
||||
steps:
|
||||
- name: Setup smbclient
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt install -y libjansson4 libcap2 libbsd0 libreadline8 libicu70
|
||||
sudo mkdir -p /etc/samba /var/lib/samba/private
|
||||
echo "[global]\nclient min protocol = SMB2\nclient max protocol = SMB3" | sudo tee /etc/samba/smb.conf
|
||||
sudo wget "https://github.com/icewind1991/smbclient-builder/releases/download/v0.2.0/smbclient-${{ matrix.client-version }}" -O /usr/local/bin/smbclient
|
||||
sudo chmod +x /usr/local/bin/smbclient
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup PHP
|
||||
uses: https://github.com/shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.2
|
||||
extensions: apcu, smbclient
|
||||
- name: Composer
|
||||
run: composer install
|
||||
- name: Config
|
||||
run: |
|
||||
echo '{"host": "samba","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
|
||||
- name: PHPUnit Tests
|
||||
uses: https://github.com/nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
retry_on: timeout
|
||||
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml
|
||||
env:
|
||||
BACKEND: smbclient
|
||||
|
||||
alpine-test:
|
||||
runs-on: alpine-latest
|
||||
name: Unit tests (alpine)
|
||||
|
||||
services:
|
||||
samba:
|
||||
image: "servercontainers/samba"
|
||||
env:
|
||||
ACCOUNT_test: test
|
||||
UID_test: 1000
|
||||
SAMBA_VOLUME_CONFIG_test:
|
||||
"[test]; path=/tmp; valid users = test; guest ok = no; read only =
|
||||
no; browseable = yes"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
shell: sh
|
||||
run: |
|
||||
apk add bash sudo git coreutils samba-client php composer php-curl php-iconv php-mbstring php-openssl php-zip php-phar php-tokenizer php-dom php-xml php-xmlwriter
|
||||
- name: Composer
|
||||
run: composer install
|
||||
- name: Config
|
||||
run: |
|
||||
echo '{"host": "samba","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
|
||||
- name: PHPUnit Tests - smbclient
|
||||
uses: https://github.com/nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
retry_on: timeout
|
||||
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml
|
||||
env:
|
||||
BACKEND: smbclient
|
||||
# smb-versions:
|
||||
# runs-on: ubuntu-22.04
|
||||
# name:
|
||||
# Unit tests - Samba ${{ matrix.server-version }} - smbclient ${{
|
||||
# matrix.client-version }}
|
||||
#
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# client-version:
|
||||
# - "4.21.4"
|
||||
# - "4.20.4"
|
||||
# - "4.19.5"
|
||||
# - "4.18.1"
|
||||
# - "4.17.7"
|
||||
# - "4.16.10"
|
||||
# - "4.15.13"
|
||||
# - "4.14.9"
|
||||
# - "4.11.17"
|
||||
# server-version:
|
||||
# - "latest"
|
||||
# - "4.9.4"
|
||||
# - "4.8.5"
|
||||
#
|
||||
# services:
|
||||
# samba:
|
||||
# image: "servercontainers/samba:${{ matrix.server-version }}"
|
||||
# env:
|
||||
# ACCOUNT_test: test
|
||||
# UID_test: 1000
|
||||
# SAMBA_VOLUME_CONFIG_test:
|
||||
# "[test]; path=/tmp; valid users = test; guest ok = no; read only =
|
||||
# no; browseable = yes"
|
||||
#
|
||||
# steps:
|
||||
# - name: Setup smbclient
|
||||
# env:
|
||||
# DEBIAN_FRONTEND: noninteractive
|
||||
# run: |
|
||||
# sudo apt-get update
|
||||
# sudo apt install -y libjansson4 libcap2 libbsd0 libreadline8 libicu70
|
||||
# sudo mkdir -p /etc/samba /var/lib/samba/private
|
||||
# echo "[global]\nclient min protocol = SMB2\nclient max protocol = SMB3" | sudo tee /etc/samba/smb.conf
|
||||
# sudo wget "https://github.com/icewind1991/smbclient-builder/releases/download/v0.2.0/smbclient-${{ matrix.client-version }}" -O /usr/local/bin/smbclient
|
||||
# sudo chmod +x /usr/local/bin/smbclient
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Setup PHP
|
||||
# uses: https://github.com/shivammathur/setup-php@v2
|
||||
# with:
|
||||
# php-version: 8.2
|
||||
# extensions: apcu, smbclient
|
||||
# - name: Composer
|
||||
# run: composer install
|
||||
# - name: Config
|
||||
# run: |
|
||||
# echo '{"host": "samba","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
|
||||
# - name: PHPUnit Tests
|
||||
# uses: https://github.com/nick-invision/retry@v2
|
||||
# with:
|
||||
# timeout_minutes: 2
|
||||
# max_attempts: 3
|
||||
# retry_on: timeout
|
||||
# command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml
|
||||
# env:
|
||||
# BACKEND: smbclient
|
||||
#
|
||||
# alpine-test:
|
||||
# runs-on: alpine-latest
|
||||
# name: Unit tests (alpine)
|
||||
#
|
||||
# services:
|
||||
# samba:
|
||||
# image: "servercontainers/samba"
|
||||
# env:
|
||||
# ACCOUNT_test: test
|
||||
# UID_test: 1000
|
||||
# SAMBA_VOLUME_CONFIG_test:
|
||||
# "[test]; path=/tmp; valid users = test; guest ok = no; read only =
|
||||
# no; browseable = yes"
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Install dependencies
|
||||
# shell: sh
|
||||
# run: |
|
||||
# apk add bash sudo git coreutils samba-client php composer php-curl php-iconv php-mbstring php-openssl php-zip php-phar php-tokenizer php-dom php-xml php-xmlwriter
|
||||
# - name: Composer
|
||||
# run: composer install
|
||||
# - name: Config
|
||||
# run: |
|
||||
# echo '{"host": "samba","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
|
||||
# - name: PHPUnit Tests - smbclient
|
||||
# uses: https://github.com/nick-invision/retry@v2
|
||||
# with:
|
||||
# timeout_minutes: 2
|
||||
# max_attempts: 3
|
||||
# retry_on: timeout
|
||||
# command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml
|
||||
# env:
|
||||
# BACKEND: smbclient
|
||||
|
|
|
|||
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -46,11 +46,11 @@
|
|||
"phps": "phps"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1761424893,
|
||||
"narHash": "sha256-vBYj2I6xdVImVAMU7u1CCZkZELIbbo6dzAo/9pSc6RI=",
|
||||
"lastModified": 1761438617,
|
||||
"narHash": "sha256-9j8gFMuUtd4LTOQkHBltxouXp7lvPxgE0r4uCW96Syk=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "a59a517f661f7381303588ad20c945ddf916ff5c",
|
||||
"revCount": 7,
|
||||
"rev": "a7d73a95377469d26c3cde813b32f4e8666dbfbc",
|
||||
"revCount": 11,
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/icewind/flakelight-php.git"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
};
|
||||
outputs = {flakelight-php, ...}:
|
||||
flakelight-php ./. {
|
||||
vendorHash = "sha256-biMQm0+JPJxnxlnvZMpVNhd3s/KPno8LQ/kL8D5xrHU=";
|
||||
vendorHash = "sha256-Pj19ClD0+4ONc0i3CJQ3GroaSc/039CixNuTjhXIQy4=";
|
||||
phpExtensions = all: with all; [smbclient krb5];
|
||||
testDependencies = pkgs: with pkgs; [samba];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue