forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
93 lines (82 loc) · 3.39 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
version: 2
jobs:
reorg_build:
docker:
# Any image that includes the docker client will do
- image: circleci/ruby
steps:
- checkout
- setup_remote_docker
- run: docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
- run: docker pull ubuntu:18.04
- run: |
BRANCH_TAG="$(echo $CIRCLE_BRANCH | sed -E 's/[^A-Za-z0-9]+/-/g')"
echo "export BRANCH_TAG='$BRANCH_TAG'" >> $BASH_ENV
- run: docker pull "dependabot/dependabot-core-ci:core-$BRANCH_TAG" ||
docker pull dependabot/dependabot-core:latest
- run: docker build
-t dependabot/dependabot-core:latest
-t "dependabot/dependabot-core-ci:core-$BRANCH_TAG"
--cache-from ubuntu:18.04
--cache-from "dependabot/dependabot-core-ci:core-$BRANCH_TAG"
--cache-from dependabot/dependabot-core:latest
.
- run: docker push "dependabot/dependabot-core-ci:core-$BRANCH_TAG"
- run: rm .dockerignore # we usually don't want tests etc, but here we do
- run: docker pull dependabot/dependabot-core-ci:latest || true
- run: docker build
-t dependabot/dependabot-core-ci
-f Dockerfile.ci
--cache-from ubuntu:18.04
--cache-from dependabot/dependabot-core:latest
--cache-from dependabot/dependabot-core-ci:latest
.
- run: docker run -ti dependabot/dependabot-core-ci
bash -c "cd terraform && rubocop"
- run: docker run -ti dependabot/dependabot-core-ci
bash -c "cd terraform && rspec spec --format documentation"
- run: docker push dependabot/dependabot-core-ci
build:
docker:
- image: dependabot/dependabot-core:0.1.47
working_directory: ~/dependabot-core
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ .Branch }}
- v1-dependencies-master
# Install dependencies
- run: bundle install --path ~/dependabot-core/vendor/bundle
- run: cd helpers/yarn && yarn install
- run: cd helpers/npm && yarn install
- run: cd helpers/php && composer install
- run: cd helpers/python && pyenv exec pip install -r requirements.txt && pyenv local 2.7.15 && pyenv exec pip install -r requirements.txt && pyenv local --unset
- run: cd helpers/elixir && mix deps.get
- run: cd helpers/go && make
- save_cache:
key: v1-dependencies-{{ .Branch }}-{{ epoch }}
paths:
- ~/dependabot-core/vendor/bundle
- ~/dependabot-core/helpers/yarn/node_modules
- ~/dependabot-core/helpers/npm/node_modules
- ~/dependabot-core/helpers/php/vendor
# Run code formatting linters
- run: bundle exec rubocop
- run: cd helpers/yarn && node_modules/.bin/eslint lib test bin
- run: cd helpers/npm && node_modules/.bin/eslint lib test bin
- run: cd helpers/php && vendor/bin/php-cs-fixer fix --dry-run
# Run tests
- run: cd helpers/yarn && node_modules/.bin/jest
- run: cd helpers/npm && node_modules/.bin/jest
- run: bundle exec rspec spec --format documentation --format RspecJunitFormatter -o ~/rspec/rspec.xml --tag "~skip_ci"
- store_test_results:
path: ~/rspec
- store_artifacts:
path: ~/rspec
workflows:
version: 2
test:
jobs:
- reorg_build
- build