mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
ci
This commit is contained in:
parent
20efdbafe8
commit
a7fb16671a
2 changed files with 34 additions and 35 deletions
|
|
@ -1,22 +1,27 @@
|
|||
# SPDX-FileCopyrightText: 2021 Robin Appelman <robin@icewind.nl>
|
||||
# SPDX-License-Identifier: MIT
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
php-cs-fixer:
|
||||
name: PHP-CS-Fixer
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
uses: https://github.com/shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.0'
|
||||
extensions: apcu
|
||||
- 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:
|
||||
args: --diff --dry-run --allow-risky yes --stop-on-violation --using-cache=no --path-mode=intersection
|
||||
|
||||
|
|
@ -47,9 +52,6 @@ jobs:
|
|||
ACCOUNT_test: test
|
||||
UID_test: 1000
|
||||
SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes"
|
||||
ports:
|
||||
- 139:139
|
||||
- 445:445
|
||||
|
||||
steps:
|
||||
- name: Install packages
|
||||
|
|
@ -57,7 +59,7 @@ jobs:
|
|||
sudo apt-get install smbclient libsmbclient-dev
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
uses: https://github.com/shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
extensions: apcu, smbclient
|
||||
|
|
@ -66,9 +68,11 @@ jobs:
|
|||
run: composer install
|
||||
- name: Config
|
||||
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
|
||||
uses: nick-invision/retry@v2
|
||||
uses: https://github.com/nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
|
|
@ -76,7 +80,7 @@ jobs:
|
|||
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml --coverage-clover=coverage.xml
|
||||
env:
|
||||
BACKEND: ${{ matrix.backend }}
|
||||
- uses: codecov/codecov-action@v3
|
||||
- uses: https://github.com/codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
|
||||
|
|
@ -109,9 +113,6 @@ jobs:
|
|||
ACCOUNT_test: test
|
||||
UID_test: 1000
|
||||
SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes"
|
||||
ports:
|
||||
- 139:139
|
||||
- 445:445
|
||||
|
||||
steps:
|
||||
- name: Setup smbclient
|
||||
|
|
@ -123,7 +124,7 @@ jobs:
|
|||
sudo chmod +x /usr/local/bin/smbclient
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
uses: https://github.com/shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.0
|
||||
extensions: apcu, smbclient
|
||||
|
|
@ -132,9 +133,11 @@ jobs:
|
|||
run: composer install
|
||||
- name: Config
|
||||
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
|
||||
uses: nick-invision/retry@v2
|
||||
uses: https://github.com/nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
|
|
@ -142,12 +145,12 @@ jobs:
|
|||
command: php ./vendor/bin/phpunit tests -c tests/phpunit.xml --coverage-clover=coverage.xml
|
||||
env:
|
||||
BACKEND: smbclient
|
||||
- uses: codecov/codecov-action@v3
|
||||
- uses: https://github.com/codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
|
||||
alpine-test:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Unit tests (alpine)
|
||||
|
||||
services:
|
||||
|
|
@ -157,14 +160,11 @@ jobs:
|
|||
ACCOUNT_test: test
|
||||
UID_test: 1000
|
||||
SAMBA_VOLUME_CONFIG_test: "[test]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes"
|
||||
ports:
|
||||
- 139:139
|
||||
- 445:445
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
uses: https://github.com/shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.0
|
||||
- name: Composer
|
||||
|
|
@ -174,20 +174,18 @@ jobs:
|
|||
docker pull icewind1991/smbclient-php-alpine
|
||||
- name: Config
|
||||
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
|
||||
run: |
|
||||
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:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Kerberos SSO tests
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.0
|
||||
- name: Composer
|
||||
run: composer install
|
||||
- name: Pull images
|
||||
|
|
@ -212,7 +210,7 @@ jobs:
|
|||
docker logs apache
|
||||
|
||||
static-psalm-analysis:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Psalm static analysis
|
||||
|
||||
strategy:
|
||||
|
|
@ -226,6 +224,7 @@ jobs:
|
|||
- "8.1"
|
||||
- "8.2"
|
||||
- "8.3"
|
||||
- "8.4"
|
||||
|
||||
steps:
|
||||
- name: krb5-dev
|
||||
|
|
@ -233,7 +232,7 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up php
|
||||
uses: shivammathur/setup-php@master
|
||||
uses: https://github.com/shivammathur/setup-php@master
|
||||
with:
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
tools: composer:v2
|
||||
|
|
@ -248,14 +247,14 @@ jobs:
|
|||
|
||||
phpstan:
|
||||
name: PHPStan Static Analysis
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: krb5-dev
|
||||
run: sudo apt-get install -y libkrb5-dev
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
uses: https://github.com/shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.0'
|
||||
extensions: apcu, smbclient, krb5
|
||||
|
|
@ -10,6 +10,6 @@ jobs:
|
|||
reuse-compliance-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: https://github.com/actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@a46482ca367aef4454a87620aa37c2be4b2f8106 # v3.0.0
|
||||
uses: https://github.com/fsfe/reuse-action@a46482ca367aef4454a87620aa37c2be4b2f8106 # v3.0.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue