mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
workflow updates
This commit is contained in:
parent
1b3ca59a46
commit
fef8fee6c9
1 changed files with 19 additions and 21 deletions
40
.github/workflows/ci.yaml
vendored
40
.github/workflows/ci.yaml
vendored
|
|
@ -5,29 +5,29 @@ name: CI
|
||||||
jobs:
|
jobs:
|
||||||
php-cs-fixer:
|
php-cs-fixer:
|
||||||
name: PHP-CS-Fixer
|
name: PHP-CS-Fixer
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.0'
|
php-version: '8.2'
|
||||||
extensions: apcu
|
extensions: apcu
|
||||||
- name: PHP-CS-Fixer
|
- name: PHP-CS-Fixer
|
||||||
uses: OskarStark/php-cs-fixer-ga@2.16.7
|
uses: OskarStark/php-cs-fixer-ga@3.25.0
|
||||||
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
|
||||||
|
|
||||||
phpstan:
|
phpstan:
|
||||||
name: PHPStan Static Analysis
|
name: PHPStan Static Analysis
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.0'
|
php-version: '8.2'
|
||||||
extensions: apcu
|
extensions: apcu
|
||||||
- name: Composer
|
- name: Composer
|
||||||
run: composer install
|
run: composer install
|
||||||
|
|
@ -36,7 +36,7 @@ jobs:
|
||||||
./vendor/bin/phpstan analyse --level 6 src
|
./vendor/bin/phpstan analyse --level 6 src
|
||||||
|
|
||||||
phpunit:
|
phpunit:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
name: Unit tests
|
name: Unit tests
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
@ -49,29 +49,27 @@ jobs:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.0'
|
php-version: '8.2'
|
||||||
extensions: apcu
|
extensions: apcu
|
||||||
- name: Composer
|
- name: Composer
|
||||||
run: composer install
|
run: composer install
|
||||||
- name: PHPUnit Tests
|
- name: PHPUnit Tests
|
||||||
uses: docker://icewind1991/php-alpine-apcu
|
|
||||||
env:
|
env:
|
||||||
DB_PORT: 5432
|
DB_PORT: 5432
|
||||||
DB_TYPE: pgsql
|
DB_TYPE: pgsql
|
||||||
DB_HOST: db
|
DB_HOST: localhost
|
||||||
DB_USERNAME: postgres
|
DB_USERNAME: postgres
|
||||||
DB_PASSWORD: test
|
DB_PASSWORD: test
|
||||||
DB_DATABASE: postgres
|
DB_DATABASE: postgres
|
||||||
with:
|
run: |
|
||||||
entrypoint: php
|
php ./vendor/bin/phpunit test
|
||||||
args: ./vendor/bin/phpunit test
|
|
||||||
|
|
||||||
api:
|
api:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
name: Integration tests
|
name: Integration tests
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
@ -104,7 +102,7 @@ jobs:
|
||||||
- 80:80
|
- 80:80
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: copy code
|
- name: copy code
|
||||||
run: |
|
run: |
|
||||||
docker run -v src:/data --name helper busybox true
|
docker run -v src:/data --name helper busybox true
|
||||||
|
|
@ -119,8 +117,8 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v25
|
- uses: cachix/install-nix-action@v26
|
||||||
- uses: icewind1991/attic-action@v1
|
- uses: icewind1991/attic-action@v1
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
|
|
@ -133,8 +131,8 @@ jobs:
|
||||||
needs: [build, api, phpunit]
|
needs: [build, api, phpunit]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v25
|
- uses: cachix/install-nix-action@v26
|
||||||
- uses: icewind1991/attic-action@v1
|
- uses: icewind1991/attic-action@v1
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
|
|
@ -144,4 +142,4 @@ jobs:
|
||||||
- name: Push image
|
- name: Push image
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: |
|
||||||
skopeo copy --dest-creds="${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}" "docker-archive:$(nix build .#docker --print-out-paths)" "docker://demostf/proxy"
|
skopeo copy --dest-creds="${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}" "docker-archive:$(nix build .#docker --print-out-paths)" "docker://demostf/api"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue