Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Castopod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patryk Miś
Castopod
Commits
038d8b6f
Unverified
Commit
038d8b6f
authored
3 years ago
by
Yassine Doghri
Browse files
Options
Downloads
Patches
Plain Diff
ci: use artifacts instead of cache to share dependencies between jobs
parent
57f4c9db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+26
-20
26 additions, 20 deletions
.gitlab-ci.yml
with
26 additions
and
20 deletions
.gitlab-ci.yml
+
26
−
20
View file @
038d8b6f
...
...
@@ -6,33 +6,35 @@ stages:
-
bundle
-
release
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
vendor/
-
.npm/
dependencies
:
php-dependencies
:
stage
:
prepare
script
:
# Install all php dependencies
-
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
-
npm ci --cache .npm --prefer-offline
artifacts
:
paths
:
-
.npm/
lint-commit-msg
:
stage
:
quality
cache
:
key
:
${CI_COMMIT_REF_SLUG}
script
:
-
chmod +x ./scripts/lint-commit.sh
# lint commit message
-
./scripts/lint-commit.sh
-
./scripts/lint-commit.
dependencies
:
-
js-dependencies
lint-php
:
stage
:
quality
cache
:
key
:
${CI_COMMIT_REF_SLUG}
script
:
# check php code style
-
vendor/bin/ecs check --ansi
...
...
@@ -40,30 +42,30 @@ lint-php:
-
php -d memory_limit=1G vendor/bin/phpstan analyse --ansi
# run rector to check for php errors
-
vendor/bin/rector process --dry-run --ansi
dependencies
:
-
php-dependencies
lint-js
:
stage
:
quality
cache
:
key
:
${CI_COMMIT_REF_SLUG}
script
:
-
npm run prettier
-
npm run typecheck
-
npm run eslint
-
npm run stylelint
dependencies
:
-
js-dependencies
tests
:
stage
:
quality
cache
:
key
:
${CI_COMMIT_REF_SLUG}
script
:
# run phpunit without code coverage
# TODO: add code coverage
-
vendor/bin/phpunit --no-coverage
dependencies
:
-
php-dependencies
bundle
:
stage
:
bundle
cache
:
key
:
${CI_COMMIT_REF_SLUG}
script
:
# make scripts/bundle.sh executable
-
chmod +x ./scripts/bundle-prepare.sh
...
...
@@ -72,6 +74,9 @@ bundle:
# bundle castopod-host with commit ref as version
-
./scripts/bundle-prepare.sh
-
./scripts/bundle.sh ${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}
dependencies
:
-
php-dependencies
-
js-dependencies
artifacts
:
name
:
"
castopod-host-${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
paths
:
...
...
@@ -83,8 +88,6 @@ bundle:
release
:
stage
:
release
cache
:
key
:
${CI_COMMIT_REF_SLUG}
script
:
# make release scripts executable
-
chmod +x ./scripts/bundle-prepare.sh
...
...
@@ -99,6 +102,9 @@ release:
# run semantic-release script (configured in `.releaserc.json` file)
-
npm run release
dependencies
:
-
php-dependencies
-
js-dependencies
only
:
-
main
-
alpha
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment