mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 18:31:05 +00:00
ci: use artifacts instead of cache to share dependencies between jobs
This commit is contained in:
parent
57f4c9db81
commit
038d8b6f6b
@ -6,33 +6,35 @@ stages:
|
|||||||
- bundle
|
- bundle
|
||||||
- release
|
- release
|
||||||
|
|
||||||
cache:
|
php-dependencies:
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
paths:
|
|
||||||
- vendor/
|
|
||||||
- .npm/
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
stage: prepare
|
stage: prepare
|
||||||
script:
|
script:
|
||||||
# Install all php dependencies
|
# Install all php dependencies
|
||||||
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --ignore-platform-reqs
|
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --ignore-platform-reqs
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- vendor/
|
||||||
|
|
||||||
|
js-dependencies:
|
||||||
|
stage: prepare
|
||||||
|
script:
|
||||||
# Install all npm dependencies
|
# Install all npm dependencies
|
||||||
- npm ci --cache .npm --prefer-offline
|
- npm ci --cache .npm --prefer-offline
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- .npm/
|
||||||
|
|
||||||
lint-commit-msg:
|
lint-commit-msg:
|
||||||
stage: quality
|
stage: quality
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
script:
|
script:
|
||||||
- chmod +x ./scripts/lint-commit.sh
|
- chmod +x ./scripts/lint-commit.sh
|
||||||
# lint commit message
|
# lint commit message
|
||||||
- ./scripts/lint-commit.sh
|
- ./scripts/lint-commit.
|
||||||
|
dependencies:
|
||||||
|
- js-dependencies
|
||||||
|
|
||||||
lint-php:
|
lint-php:
|
||||||
stage: quality
|
stage: quality
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
script:
|
script:
|
||||||
# check php code style
|
# check php code style
|
||||||
- vendor/bin/ecs check --ansi
|
- vendor/bin/ecs check --ansi
|
||||||
@ -40,30 +42,30 @@ lint-php:
|
|||||||
- php -d memory_limit=1G vendor/bin/phpstan analyse --ansi
|
- php -d memory_limit=1G vendor/bin/phpstan analyse --ansi
|
||||||
# run rector to check for php errors
|
# run rector to check for php errors
|
||||||
- vendor/bin/rector process --dry-run --ansi
|
- vendor/bin/rector process --dry-run --ansi
|
||||||
|
dependencies:
|
||||||
|
- php-dependencies
|
||||||
|
|
||||||
lint-js:
|
lint-js:
|
||||||
stage: quality
|
stage: quality
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
script:
|
script:
|
||||||
- npm run prettier
|
- npm run prettier
|
||||||
- npm run typecheck
|
- npm run typecheck
|
||||||
- npm run eslint
|
- npm run eslint
|
||||||
- npm run stylelint
|
- npm run stylelint
|
||||||
|
dependencies:
|
||||||
|
- js-dependencies
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
stage: quality
|
stage: quality
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
script:
|
script:
|
||||||
# run phpunit without code coverage
|
# run phpunit without code coverage
|
||||||
# TODO: add code coverage
|
# TODO: add code coverage
|
||||||
- vendor/bin/phpunit --no-coverage
|
- vendor/bin/phpunit --no-coverage
|
||||||
|
dependencies:
|
||||||
|
- php-dependencies
|
||||||
|
|
||||||
bundle:
|
bundle:
|
||||||
stage: bundle
|
stage: bundle
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
script:
|
script:
|
||||||
# make scripts/bundle.sh executable
|
# make scripts/bundle.sh executable
|
||||||
- chmod +x ./scripts/bundle-prepare.sh
|
- chmod +x ./scripts/bundle-prepare.sh
|
||||||
@ -72,6 +74,9 @@ bundle:
|
|||||||
# bundle castopod-host with commit ref as version
|
# bundle castopod-host with commit ref as version
|
||||||
- ./scripts/bundle-prepare.sh
|
- ./scripts/bundle-prepare.sh
|
||||||
- ./scripts/bundle.sh ${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}
|
- ./scripts/bundle.sh ${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}
|
||||||
|
dependencies:
|
||||||
|
- php-dependencies
|
||||||
|
- js-dependencies
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "castopod-host-${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
|
name: "castopod-host-${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
|
||||||
paths:
|
paths:
|
||||||
@ -83,8 +88,6 @@ bundle:
|
|||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
script:
|
script:
|
||||||
# make release scripts executable
|
# make release scripts executable
|
||||||
- chmod +x ./scripts/bundle-prepare.sh
|
- chmod +x ./scripts/bundle-prepare.sh
|
||||||
@ -99,6 +102,9 @@ release:
|
|||||||
|
|
||||||
# run semantic-release script (configured in `.releaserc.json` file)
|
# run semantic-release script (configured in `.releaserc.json` file)
|
||||||
- npm run release
|
- npm run release
|
||||||
|
dependencies:
|
||||||
|
- php-dependencies
|
||||||
|
- js-dependencies
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
- alpha
|
- alpha
|
||||||
|
Loading…
x
Reference in New Issue
Block a user