bigbuffet-rw/.gitlab-ci.yml

145 lines
2.6 KiB
YAML
Raw Normal View History

2022-06-01 11:22:49 -07:00
image: node:18
2020-04-14 11:07:40 -07:00
variables:
NODE_ENV: test
2022-06-17 17:02:58 -07:00
cache: &cache
key:
files:
- yarn.lock
paths:
2022-05-17 04:39:59 -07:00
- node_modules/
2022-06-17 17:02:58 -07:00
policy: pull
2020-04-14 16:00:02 -07:00
2020-04-14 11:07:40 -07:00
stages:
- deps
2020-04-14 11:07:40 -07:00
- test
2020-08-30 11:59:39 -07:00
- deploy
2020-04-14 11:07:40 -07:00
deps:
stage: deps
script: yarn install --ignore-scripts
only:
changes:
- yarn.lock
2022-06-17 17:02:58 -07:00
cache:
<<: *cache
policy: push
2020-04-14 11:07:40 -07:00
danger:
stage: test
2022-06-17 16:23:53 -07:00
script:
# https://github.com/danger/danger-js/issues/1029#issuecomment-998915436
- export CI_MERGE_REQUEST_IID=${CI_OPEN_MERGE_REQUESTS#*!}
- npx danger ci
2022-06-19 12:13:35 -07:00
allow_failure: true
2020-04-14 11:07:40 -07:00
lint-js:
stage: test
2022-04-04 08:50:14 -07:00
script: yarn lint:js
only:
changes:
- "**/*.js"
2022-03-18 13:36:15 -07:00
- "**/*.jsx"
- "**/*.ts"
- "**/*.tsx"
- ".eslintignore"
- ".eslintrc.js"
2020-04-14 11:07:40 -07:00
lint-sass:
stage: test
2022-04-04 08:50:14 -07:00
script: yarn lint:sass
only:
changes:
- "**/*.scss"
- "**/*.css"
- ".stylelintrc.json"
2020-04-14 11:07:40 -07:00
2020-04-14 16:00:02 -07:00
jest:
stage: test
2022-07-06 09:23:35 -07:00
script: yarn test:coverage --runInBand
only:
changes:
- "**/*.js"
- "**/*.json"
- "app/soapbox/**/*"
- "webpack/**/*"
- "custom/**/*"
- "jest.config.js"
- "package.json"
- "yarn.lock"
- ".gitlab-ci.yml"
2022-06-13 11:57:10 -07:00
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
artifacts:
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: .coverage/cobertura-coverage.xml
2020-04-14 11:16:08 -07:00
2022-05-20 16:47:49 -07:00
nginx-test:
stage: test
image: nginx:latest
before_script: cp installation/mastodon.conf /etc/nginx/conf.d/default.conf
script: nginx -t
only:
changes:
- "installation/mastodon.conf"
2020-04-14 11:20:07 -07:00
build-production:
stage: test
script: yarn build
2020-04-14 11:20:07 -07:00
variables:
NODE_ENV: production
2020-04-14 11:07:40 -07:00
artifacts:
paths:
- static
2020-04-14 11:07:40 -07:00
2020-08-30 11:59:39 -07:00
docs-deploy:
stage: deploy
image: alpine:latest
2020-08-29 14:51:17 -07:00
before_script:
- apk add curl
script:
- curl -X POST -F"token=$CI_JOB_TOKEN" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline
2020-08-29 11:18:51 -07:00
only:
refs:
- develop
changes:
- "docs/**/*"
2020-08-29 11:18:51 -07:00
2020-06-11 23:02:18 -07:00
# Supposed to fail when translations are outdated, instead always passes
#
# i18n:
# stage: build
# script: yarn manage:translations
# variables:
# NODE_ENV: development
# before_script:
# - yarn
# - yarn build
2022-05-18 19:48:16 -07:00
review:
stage: deploy
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_COMMIT_REF_SLUG.git.soapbox.pub
script:
- npx -y surge static $CI_COMMIT_REF_SLUG.git.soapbox.pub
2022-05-25 08:23:55 -07:00
allow_failure: true
2022-05-18 19:48:16 -07:00
pages:
stage: deploy
2021-09-06 21:59:19 -07:00
before_script: []
script:
2021-09-06 21:59:19 -07:00
# artifacts are kept between jobs
- mv static public
variables:
NODE_ENV: production
artifacts:
paths:
- public
only:
refs:
- develop