Skip to content

Commit e64e332

Browse files
Merge pull request #243 from supertokens/cicd-change
chore: Change circleci configs to add parallelism
2 parents bd5453a + 63af335 commit e64e332

File tree

3 files changed

+159
-113
lines changed

3 files changed

+159
-113
lines changed

.circleci/config.yml

Lines changed: 27 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,32 @@
11
version: 2.1
2+
3+
# this allows you to use CircleCI's dynamic configuration feature
4+
setup: true
5+
26
orbs:
3-
slack: circleci/[email protected]
4-
jq: circleci/[email protected]
7+
continuation: circleci/[email protected]
8+
slack: circleci/[email protected]
9+
jq: circleci/[email protected]
510
jobs:
6-
test-dev-tag-as-not-passed:
7-
docker:
8-
- image: rishabhpoddar/supertokens_go_driver_testing
9-
steps:
10-
- checkout
11-
- run: (cd .circleci/ && ./markDevTagAsTestNotPassed.sh)
12-
test-unit:
13-
docker:
14-
- image: rishabhpoddar/supertokens_go_driver_testing
15-
resource_class: large
16-
steps:
17-
- checkout
18-
- run: apt-get install lsof
19-
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
20-
- run: go version
21-
- run: rm -rf /etc/alternatives/java
22-
- run: ln -s /usr/java/jdk-15.0.1/bin/java /etc/alternatives/java
23-
- run: go get ./...
24-
- run: (cd .circleci/ && ./doUnitTests.sh)
25-
- slack/status
26-
test-website:
27-
docker:
28-
- image: rishabhpoddar/supertokens_go_driver_testing
29-
resource_class: large
30-
steps:
31-
- checkout
32-
- run: apt-get install lsof
33-
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
34-
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
35-
- run: go version
36-
- run: rm -rf /etc/alternatives/java
37-
- run: ln -s /usr/java/jdk-15.0.1/bin/java /etc/alternatives/java
38-
- run: go get ./...
39-
- run: (cd .circleci/ && ./website.sh)
40-
- slack/status
41-
test-authreact:
42-
docker:
43-
- image: rishabhpoddar/supertokens_go_driver_testing
44-
resource_class: large
45-
steps:
46-
- checkout
47-
- run: apt-get install lsof
48-
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
49-
- run: curl -fsSL https://deb.nodesource.com/setup_16.x | bash
50-
- run: apt install -y nodejs
51-
- run: node --version
52-
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
53-
- run: go version
54-
- run: rm -rf /etc/alternatives/java
55-
- run: ln -s /usr/java/jdk-15.0.1/bin/java /etc/alternatives/java
56-
- run: go get ./...
57-
- run: (cd .circleci/ && ./authReact.sh)
58-
- slack/status
59-
test-success:
60-
docker:
61-
- image: rishabhpoddar/supertokens_go_driver_testing
62-
steps:
63-
- checkout
64-
- run: (cd .circleci/ && ./markAsSuccess.sh)
65-
- slack/status
11+
setup:
12+
machine:
13+
image: ubuntu-2204:2022.04.1
14+
steps:
15+
- checkout
16+
- run:
17+
name: Generate config
18+
command: |
19+
cd .circleci && ./generateConfig.sh
20+
- continuation/continue:
21+
configuration_path: .circleci/config_continue.yml # use newly generated config to continue
6622

6723
workflows:
68-
version: 2
69-
tagged-build:
70-
jobs:
71-
- test-dev-tag-as-not-passed:
72-
filters:
73-
tags:
74-
only: /dev-v[0-9]+(\.[0-9]+)*/
75-
branches:
76-
ignore: /.*/
77-
- test-unit:
78-
requires:
79-
- test-dev-tag-as-not-passed
80-
context:
81-
- slack-notification
82-
filters:
83-
tags:
84-
only: /dev-v[0-9]+(\.[0-9]+)*/
85-
branches:
86-
ignore: /.*/
87-
- test-website:
88-
requires:
89-
- test-dev-tag-as-not-passed
90-
context:
91-
- slack-notification
92-
filters:
93-
tags:
94-
only: /dev-v[0-9]+(\.[0-9]+)*/
95-
branches:
96-
ignore: /.*/
97-
- test-authreact:
98-
requires:
99-
- test-dev-tag-as-not-passed
100-
context:
101-
- slack-notification
102-
filters:
103-
tags:
104-
only: /dev-v[0-9]+(\.[0-9]+)*/
105-
branches:
106-
ignore: /.*/
107-
- test-success:
108-
requires:
109-
- test-unit
110-
- test-website
111-
- test-authreact
112-
context:
113-
- slack-notification
114-
filters:
115-
tags:
116-
only: /dev-v[0-9]+(\.[0-9]+)*/
117-
branches:
118-
ignore: /.*/
24+
version: 2
25+
tagged-build:
26+
jobs:
27+
- setup:
28+
filters:
29+
tags:
30+
only: /dev-v[0-9]+(\.[0-9]+)*/
31+
branches:
32+
ignore: /.*/

.circleci/config_continue.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
version: 2.1
2+
orbs:
3+
continuation: circleci/[email protected]
4+
slack: circleci/[email protected]
5+
jq: circleci/[email protected]
6+
jobs:
7+
test-dev-tag-as-not-passed:
8+
docker:
9+
- image: rishabhpoddar/supertokens_go_driver_testing
10+
steps:
11+
- checkout
12+
- run: (cd .circleci/ && ./markDevTagAsTestNotPassed.sh)
13+
test-unit:
14+
docker:
15+
- image: rishabhpoddar/supertokens_go_driver_testing
16+
resource_class: large
17+
parameters:
18+
cdi-version:
19+
type: string
20+
parallelism: 4
21+
steps:
22+
- checkout
23+
- run: apt-get install lsof
24+
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
25+
- run: go version
26+
- run: rm -rf /etc/alternatives/java
27+
- run: ln -s /usr/java/jdk-15.0.1/bin/java /etc/alternatives/java
28+
- run: go get ./...
29+
- run: (cd .circleci/ && ./doUnitTests.sh << parameters.cdi-version >>)
30+
- slack/status
31+
test-website:
32+
docker:
33+
- image: rishabhpoddar/supertokens_go_driver_testing
34+
resource_class: large
35+
steps:
36+
- checkout
37+
- run: apt-get install lsof
38+
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
39+
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
40+
- run: go version
41+
- run: rm -rf /etc/alternatives/java
42+
- run: ln -s /usr/java/jdk-15.0.1/bin/java /etc/alternatives/java
43+
- run: go get ./...
44+
- run: (cd .circleci/ && ./website.sh)
45+
- slack/status
46+
test-authreact:
47+
docker:
48+
- image: rishabhpoddar/supertokens_go_driver_testing
49+
resource_class: large
50+
steps:
51+
- checkout
52+
- run: apt-get install lsof
53+
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
54+
- run: curl -fsSL https://deb.nodesource.com/setup_16.x | bash
55+
- run: apt install -y nodejs
56+
- run: node --version
57+
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
58+
- run: go version
59+
- run: rm -rf /etc/alternatives/java
60+
- run: ln -s /usr/java/jdk-15.0.1/bin/java /etc/alternatives/java
61+
- run: go get ./...
62+
- run: (cd .circleci/ && ./authReact.sh)
63+
- slack/status
64+
test-success:
65+
docker:
66+
- image: rishabhpoddar/supertokens_go_driver_testing
67+
steps:
68+
- checkout
69+
- run: (cd .circleci/ && ./markAsSuccess.sh)
70+
- slack/status
71+
72+
workflows:
73+
version: 2
74+
tagged-build:
75+
jobs:
76+
- test-dev-tag-as-not-passed:
77+
filters:
78+
tags:
79+
only: /dev-v[0-9]+(\.[0-9]+)*/
80+
branches:
81+
ignore: /.*/
82+
- test-unit:
83+
requires:
84+
- test-dev-tag-as-not-passed
85+
context:
86+
- slack-notification
87+
filters:
88+
tags:
89+
only: /dev-v[0-9]+(\.[0-9]+)*/
90+
branches:
91+
ignore: /.*/
92+
- test-website:
93+
requires:
94+
- test-dev-tag-as-not-passed
95+
context:
96+
- slack-notification
97+
filters:
98+
tags:
99+
only: /dev-v[0-9]+(\.[0-9]+)*/
100+
branches:
101+
ignore: /.*/
102+
- test-authreact:
103+
requires:
104+
- test-dev-tag-as-not-passed
105+
context:
106+
- slack-notification
107+
filters:
108+
tags:
109+
only: /dev-v[0-9]+(\.[0-9]+)*/
110+
branches:
111+
ignore: /.*/
112+
- test-success:
113+
requires:
114+
- test-unit
115+
- test-website
116+
- test-authreact
117+
context:
118+
- slack-notification
119+
filters:
120+
tags:
121+
only: /dev-v[0-9]+(\.[0-9]+)*/
122+
branches:
123+
ignore: /.*/

.circleci/generateConfig.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
coreDriverJson=`cat ../coreDriverInterfaceSupported.json`
2+
coreDriverArray=`echo $coreDriverJson | jq ".versions"`
3+
4+
if [ -z "$SUPERTOKENS_API_KEY" ]; then
5+
echo "SUPERTOKENS_API_KEY missing"
6+
exit 1;
7+
fi
8+
9+
sed -i -e 's/cdi-version: placeholder/cdi-version: '`printf "%q" $coreDriverArray`'/' config_continue.yml

0 commit comments

Comments
 (0)