mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Used ci-setup composite action as much as possible in ci workflow
This commit is contained in:
parent
763002ae14
commit
eb21833d94
28
.github/workflows/ci-db-tests.yml
vendored
28
.github/workflows/ci-db-tests.yml
vendored
@ -16,39 +16,19 @@ jobs:
|
|||||||
php-version: [ '8.1' ]
|
php-version: [ '8.1' ]
|
||||||
env:
|
env:
|
||||||
LC_ALL: C
|
LC_ALL: C
|
||||||
extensions: openswoole-4.11.1, pdo_sqlsrv-5.10.1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Install MSSQL ODBC
|
- name: Install MSSQL ODBC
|
||||||
if: ${{ inputs.platform == 'ms' }}
|
if: ${{ inputs.platform == 'ms' }}
|
||||||
run: sudo ./data/infra/ci/install-ms-odbc.sh
|
run: sudo ./data/infra/ci/install-ms-odbc.sh
|
||||||
- name: Start database server
|
- name: Start database server
|
||||||
if: ${{ inputs.platform != 'sqlite:ci' }}
|
if: ${{ inputs.platform != 'sqlite:ci' }}
|
||||||
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_${{ inputs.platform }}
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_${{ inputs.platform }}
|
||||||
- name: Setup cache environment
|
- uses: './.github/actions/ci-setup'
|
||||||
id: extcache
|
|
||||||
uses: shivammathur/cache-extensions@v1
|
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
extensions: ${{ env.extensions }}
|
php-extensions: openswoole-4.11.1, pdo_sqlsrv-5.10.1
|
||||||
key: db-tests-extensions-${{ matrix.php-version }}-${{ inputs.platform }}
|
extensions-cache-key: db-tests-extensions-${{ matrix.php-version }}-${{ inputs.platform }}
|
||||||
- name: Cache extensions
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.extcache.outputs.dir }}
|
|
||||||
key: ${{ steps.extcache.outputs.key }}
|
|
||||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
|
||||||
- name: Use PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: ${{ matrix.php-version }}
|
|
||||||
tools: composer
|
|
||||||
extensions: ${{ env.extensions }}
|
|
||||||
coverage: pcov
|
|
||||||
ini-values: pcov.directory=module
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install --no-interaction --prefer-dist
|
|
||||||
- name: Create test database
|
- name: Create test database
|
||||||
if: ${{ inputs.platform == 'ms' }}
|
if: ${{ inputs.platform == 'ms' }}
|
||||||
run: docker-compose exec -T shlink_db_ms /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Passw0rd!' -Q "CREATE DATABASE shlink_test;"
|
run: docker-compose exec -T shlink_db_ms /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Passw0rd!' -Q "CREATE DATABASE shlink_test;"
|
||||||
|
29
.github/workflows/ci-tests.yml
vendored
29
.github/workflows/ci-tests.yml
vendored
@ -14,40 +14,19 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version: ['8.1']
|
php-version: ['8.1']
|
||||||
env:
|
|
||||||
extensions: openswoole-4.11.1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Start postgres database server
|
- name: Start postgres database server
|
||||||
if: ${{ inputs.test-group == 'api' }}
|
if: ${{ inputs.test-group == 'api' }}
|
||||||
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
|
||||||
- name: Start maria database server
|
- name: Start maria database server
|
||||||
if: ${{ inputs.test-group == 'cli' }}
|
if: ${{ inputs.test-group == 'cli' }}
|
||||||
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_maria
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_maria
|
||||||
- name: Setup cache environment
|
- uses: './.github/actions/ci-setup'
|
||||||
id: extcache
|
|
||||||
uses: shivammathur/cache-extensions@v1
|
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
extensions: ${{ env.extensions }}
|
php-extensions: openswoole-4.11.1
|
||||||
key: tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
|
extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
|
||||||
- name: Cache extensions
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.extcache.outputs.dir }}
|
|
||||||
key: ${{ steps.extcache.outputs.key }}
|
|
||||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
|
||||||
- name: Use PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: ${{ matrix.php-version }}
|
|
||||||
tools: composer
|
|
||||||
extensions: ${{ env.extensions }}
|
|
||||||
coverage: pcov
|
|
||||||
ini-values: pcov.directory=module
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install --no-interaction --prefer-dist
|
|
||||||
- run: composer test:${{ inputs.test-group }}:ci
|
- run: composer test:${{ inputs.test-group }}:ci
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: ${{ matrix.php-version == '8.1' }}
|
if: ${{ matrix.php-version == '8.1' }}
|
||||||
|
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@ -15,33 +15,13 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
php-version: ['8.1']
|
php-version: ['8.1']
|
||||||
command: ['cs', 'stan', 'swagger:validate']
|
command: ['cs', 'stan', 'swagger:validate']
|
||||||
env:
|
|
||||||
extensions: openswoole-4.11.1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
- uses: './.github/actions/ci-setup'
|
||||||
- name: Setup cache environment
|
|
||||||
id: extcache
|
|
||||||
uses: shivammathur/cache-extensions@v1
|
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
extensions: ${{ env.extensions }}
|
php-extensions: openswoole-4.11.1
|
||||||
key: tests-extensions-${{ matrix.php-version }}-${{ matrix.command }}
|
extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ matrix.command }}
|
||||||
- name: Cache extensions
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.extcache.outputs.dir }}
|
|
||||||
key: ${{ steps.extcache.outputs.key }}
|
|
||||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
|
||||||
- name: Use PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: ${{ matrix.php-version }}
|
|
||||||
tools: composer
|
|
||||||
extensions: ${{ env.extensions }}
|
|
||||||
coverage: none
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install --no-interaction --prefer-dist
|
|
||||||
- run: composer ${{ matrix.command }}
|
- run: composer ${{ matrix.command }}
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
|
29
.github/workflows/publish-release.yml
vendored
29
.github/workflows/publish-release.yml
vendored
@ -12,30 +12,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
php-version: ['8.1']
|
php-version: ['8.1']
|
||||||
swoole: ['yes', 'no']
|
swoole: ['yes', 'no']
|
||||||
env:
|
|
||||||
extensions: openswoole-4.11.1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
- uses: './.github/actions/ci-setup'
|
||||||
- name: Setup cache environment
|
|
||||||
id: extcache
|
|
||||||
uses: shivammathur/cache-extensions@v1
|
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
extensions: ${{ env.extensions }}
|
php-extensions: openswoole-4.11.1
|
||||||
key: publish-release-extensions-${{ matrix.php-version }}-${{ matrix.swoole }}
|
extensions-cache-key: publish-swagger-spec-extensions-${{ matrix.php-version }}
|
||||||
- name: Cache extensions
|
install-deps: 'no'
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.extcache.outputs.dir }}
|
|
||||||
key: ${{ steps.extcache.outputs.key }}
|
|
||||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
|
||||||
- name: Use PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: ${{ matrix.php-version }}
|
|
||||||
tools: composer
|
|
||||||
extensions: ${{ env.extensions }}
|
|
||||||
- if: ${{ matrix.swoole == 'yes' }}
|
- if: ${{ matrix.swoole == 'yes' }}
|
||||||
run: ./build.sh ${GITHUB_REF#refs/tags/v}
|
run: ./build.sh ${GITHUB_REF#refs/tags/v}
|
||||||
- if: ${{ matrix.swoole == 'no' }}
|
- if: ${{ matrix.swoole == 'no' }}
|
||||||
@ -49,8 +33,7 @@ jobs:
|
|||||||
needs: ['build']
|
needs: ['build']
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: build
|
path: build
|
||||||
|
27
.github/workflows/publish-swagger-spec.yml
vendored
27
.github/workflows/publish-swagger-spec.yml
vendored
@ -11,36 +11,17 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version: ['8.1']
|
php-version: ['8.1']
|
||||||
env:
|
|
||||||
extensions: openswoole-4.11.1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Determine version
|
- name: Determine version
|
||||||
id: determine_version
|
id: determine_version
|
||||||
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
|
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Setup cache environment
|
- uses: './.github/actions/ci-setup'
|
||||||
id: extcache
|
|
||||||
uses: shivammathur/cache-extensions@v1
|
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
extensions: ${{ env.extensions }}
|
php-extensions: openswoole-4.11.1
|
||||||
key: publish-swagger-spec-extensions-${{ matrix.php-version }}
|
extensions-cache-key: publish-swagger-spec-extensions-${{ matrix.php-version }}
|
||||||
- name: Cache extensions
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.extcache.outputs.dir }}
|
|
||||||
key: ${{ steps.extcache.outputs.key }}
|
|
||||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
|
||||||
- name: Use PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: ${{ matrix.php-version }}
|
|
||||||
tools: composer
|
|
||||||
extensions: ${{ env.extensions }}
|
|
||||||
coverage: none
|
|
||||||
- run: composer install --no-interaction --prefer-dist
|
|
||||||
- run: composer swagger:inline
|
- run: composer swagger:inline
|
||||||
- run: mkdir ${{ steps.determine_version.outputs.version }}
|
- run: mkdir ${{ steps.determine_version.outputs.version }}
|
||||||
- run: mv docs/swagger/swagger-inlined.json ${{ steps.determine_version.outputs.version }}/open-api-spec.json
|
- run: mv docs/swagger/swagger-inlined.json ${{ steps.determine_version.outputs.version }}/open-api-spec.json
|
||||||
|
Loading…
Reference in New Issue
Block a user