Skip to content

Commit 7d1eedd

Browse files
committed
Add build matrix generator
This new build matrix generator is based on the one for Node.js library. The main difference this one has is that we only test for one Node.js version (the latest one). Also added a matrix validation step, and linters for Ruby and JS code. There's a small modification on test files lookup because React based libraries files extension ends with "x"
1 parent 21f5be4 commit 7d1eedd

File tree

9 files changed

+546
-74
lines changed

9 files changed

+546
-74
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,5 @@ dist/
7171

7272
# VS Code
7373
.vscode/
74+
75+
tmp

.rubocop.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
AllCops:
2+
DisplayCopNames: true
3+
UseCache: true
4+
CacheRootDirectory: ./tmp
5+
NewCops: enable
6+
Exclude:
7+
- "node_modules/**/*"
8+
- "test/integration/diagnose/**/*"
9+
10+
Style/Documentation:
11+
Enabled: false
12+
13+
Style/StringLiterals:
14+
EnforcedStyle: double_quotes
15+
16+
Style/StringLiteralsInInterpolation:
17+
EnforcedStyle: double_quotes
18+
19+
Style/HashSyntax:
20+
EnforcedStyle: hash_rockets
21+
22+
Layout/HashAlignment:
23+
EnforcedLastArgumentHashStyle: ignore_implicit
24+
25+
Layout/ArgumentAlignment:
26+
EnforcedStyle: with_fixed_indentation
27+
28+
Layout/ParameterAlignment:
29+
EnforcedStyle: with_fixed_indentation
30+
31+
Layout/MultilineMethodCallIndentation:
32+
EnforcedStyle: indented
33+
34+
Layout/MultilineOperationIndentation:
35+
EnforcedStyle: indented
36+
37+
Layout/FirstArrayElementIndentation:
38+
EnforcedStyle: consistent
39+
40+
Layout/LineEndStringConcatenationIndentation:
41+
EnforcedStyle: indented
42+
43+
Layout/EmptyLineBetweenDefs:
44+
AllowAdjacentOneLineDefs: true
45+
46+
Layout/LineLength:
47+
Max: 100
48+
49+
Style/Lambda:
50+
EnforcedStyle: lambda
51+
52+
Style/WordArray:
53+
Enabled: false
54+
55+
Style/FrozenStringLiteralComment:
56+
Enabled: true
57+
58+
Style/SymbolArray:
59+
EnforcedStyle: brackets
60+
61+
Metrics/AbcSize:
62+
Enabled: false
63+
64+
Metrics/BlockLength:
65+
Exclude:
66+
- Rakefile
67+
- "**/spec/*.rb"
68+
69+
Metrics/MethodLength:
70+
Max: 25
71+
Exclude:
72+
- Rakefile

.semaphore/semaphore.yml

+114-72
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# DO NOT EDIT
2+
# This is a generated file by the `rake build_matrix:semaphore:generate` task.
3+
# See `build_matrix.yml` for the build matrix.
4+
# Generate this file with `rake build_matrix:semaphore:generate`.
5+
---
16
version: v1.0
27
name: AppSignal for JavaScript
38
agent:
@@ -15,76 +20,113 @@ global_job_config:
1520
value: test
1621
prologue:
1722
commands:
18-
- checkout
23+
- checkout
24+
- '[ -n "$NODE_VERSION" ] && sem-version node $NODE_VERSION || echo Skipping Node.js
25+
install'
26+
- script/setup
27+
- source ~/.bashrc
1928
blocks:
20-
- name: Linters
21-
dependencies: []
22-
task:
23-
jobs:
24-
- name: Git Lint (Lintje)
25-
commands:
26-
- script/lint_git
27-
- name: "Install and Build"
28-
dependencies: []
29-
task:
30-
prologue:
31-
commands:
32-
- sem-version node 12
33-
# Mono setup
34-
- script/setup
35-
- source ~/.bashrc
36-
- mono bootstrap --ci
37-
- cache store
38-
jobs:
39-
- name: Build
40-
commands:
41-
- mono build
42-
- cache store packages-$SEMAPHORE_GIT_SHA-$SEMAPHORE_GIT_BRANCH packages
43-
- name: "Tests"
44-
dependencies: ["Install and Build"]
45-
task:
46-
prologue:
47-
commands:
48-
- sem-version node 12
49-
# Mono setup
50-
- script/setup
51-
- source ~/.bashrc
52-
- mono bootstrap --ci
53-
54-
- cache restore
55-
- cache restore packages-$SEMAPHORE_GIT_SHA-$SEMAPHORE_GIT_BRANCH
56-
jobs:
57-
- name: All
58-
commands:
59-
- mono test
60-
# - name: JavaScript Core
61-
# commands:
62-
# - mono test --package "@appsignal/core"
63-
# - name: "Integrations"
64-
# dependencies: ["Install and Build"]
65-
# task:
66-
# prologue:
67-
# commands:
68-
# - cache restore
69-
# - cache restore packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
70-
# jobs:
71-
# - name: Preact
72-
# commands:
73-
# - mono test --package "@appsignal/preact"
74-
# - name: React
75-
# commands:
76-
# - mono test --package "@appsignal/react"
77-
# - name: Vue
78-
# commands:
79-
# - mono test --package "@appsignal/vue"
80-
# - name: "Plugins"
81-
# dependencies: ["Install and Build"]
82-
# task:
83-
# prologue:
84-
# commands:
85-
# - cache restore
86-
# - cache restore packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
87-
# jobs:
88-
# - name: Window Events
89-
# commands:
90-
# - mono test --package "@appsignal/plugin-window-events"
29+
- name: Validation
30+
dependencies: []
31+
task:
32+
jobs:
33+
- name: Validate CI setup
34+
commands:
35+
- rake build_matrix:semaphore:validate
36+
- name: Linters
37+
dependencies: []
38+
task:
39+
jobs:
40+
- name: Ruby Lint (RuboCop)
41+
commands:
42+
- cache restore $_BUNDLER_CACHE-bundler-$(checksum Gemfile.lock)
43+
- bundle config set clean 'true'
44+
- bundle config set path .bundle
45+
- bundle install --jobs=3 --retry=3
46+
- cache store $_BUNDLER_CACHE-bundler-$(checksum Gemfile.log) .bundle
47+
- bundle exec rubocop
48+
- name: JavaScript Lint (Prettier)
49+
env_vars:
50+
- name: NODE_VERSION
51+
value: '16'
52+
commands:
53+
- cache restore
54+
- mono bootstrap --ci
55+
- cache store
56+
- mono bootstrap
57+
- npm run lint
58+
- name: Git Lint (Lintje)
59+
commands:
60+
- script/lint_git
61+
- name: JavaScript with Node.js 16 - build
62+
dependencies:
63+
- Validation
64+
task:
65+
prologue:
66+
commands:
67+
- cache restore
68+
- mono bootstrap --ci
69+
- cache store
70+
jobs:
71+
- name: Build
72+
commands:
73+
- mono build
74+
- cache store $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION packages
75+
- name: JavaScript - Tests
76+
dependencies:
77+
- JavaScript with Node.js 16 - build
78+
task:
79+
env_vars:
80+
- name: NODE_VERSION
81+
value: '16'
82+
prologue:
83+
commands:
84+
- cache restore
85+
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
86+
- mono bootstrap --ci
87+
jobs:
88+
- name: "@appsignal/core - core"
89+
commands:
90+
- mono test --package=@appsignal/core
91+
- name: "@appsignal/javascript - javascript"
92+
commands:
93+
- mono test --package=@appsignal/javascript
94+
- name: "@appsignal/plugin-window-events - plugin-window-events"
95+
commands:
96+
- mono test --package=@appsignal/plugin-window-events
97+
- name: "@appsignal/preact - preact@latest"
98+
commands:
99+
- cd packages/preact && npm install preact@latest --save-dev
100+
- mono test --package=@appsignal/preact
101+
- name: "@appsignal/preact - [email protected]"
102+
commands:
103+
- cd packages/preact && npm install [email protected] --save-dev
104+
- mono test --package=@appsignal/preact
105+
- name: "@appsignal/preact - [email protected]"
106+
commands:
107+
- cd packages/preact && npm install [email protected] --save-dev
108+
- mono test --package=@appsignal/preact
109+
- name: "@appsignal/react - react@latest"
110+
commands:
111+
- cd packages/react && npm install react@latest --save-dev
112+
- mono test --package=@appsignal/react
113+
- name: "@appsignal/react - [email protected]"
114+
commands:
115+
- cd packages/react && npm install [email protected] --save-dev
116+
- mono test --package=@appsignal/react
117+
- name: "@appsignal/react - [email protected]"
118+
commands:
119+
- cd packages/react && npm install [email protected] --save-dev
120+
- mono test --package=@appsignal/react
121+
- name: "@appsignal/vue - vue@latest"
122+
commands:
123+
- cd packages/vue && npm install vue@latest --save-dev
124+
- mono test --package=@appsignal/vue
125+
- name: "@appsignal/vue - [email protected]"
126+
commands:
127+
- cd packages/vue && npm install [email protected] --save-dev
128+
- mono test --package=@appsignal/vue
129+
- name: "@appsignal/vue - [email protected]"
130+
commands:
131+
- cd packages/vue && npm install [email protected] --save-dev
132+
- mono test --package=@appsignal/vue

Gemfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem "rubocop"

Gemfile.lock

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.4.2)
5+
parallel (1.21.0)
6+
parser (3.0.2.0)
7+
ast (~> 2.4.1)
8+
rainbow (3.0.0)
9+
regexp_parser (2.1.1)
10+
rexml (3.2.5)
11+
rubocop (1.22.1)
12+
parallel (~> 1.10)
13+
parser (>= 3.0.0.0)
14+
rainbow (>= 2.2.2, < 4.0)
15+
regexp_parser (>= 1.8, < 3.0)
16+
rexml
17+
rubocop-ast (>= 1.12.0, < 2.0)
18+
ruby-progressbar (~> 1.7)
19+
unicode-display_width (>= 1.4.0, < 3.0)
20+
rubocop-ast (1.12.0)
21+
parser (>= 3.0.1.1)
22+
ruby-progressbar (1.11.0)
23+
unicode-display_width (2.1.0)
24+
25+
PLATFORMS
26+
x86_64-darwin-20
27+
28+
DEPENDENCIES
29+
rubocop
30+
31+
BUNDLED WITH
32+
2.2.28

0 commit comments

Comments
 (0)