@@ -6,16 +6,22 @@ concurrency:
6
6
7
7
on :
8
8
pull_request :
9
+ branches : [ main, master ]
9
10
push :
11
+ branches : [ main, master ]
10
12
schedule :
11
13
- cron : ' 0 1 * * *'
12
14
15
+ permissions :
16
+ contents : read
17
+
13
18
env :
14
19
BUNDLE_RETRY : 6
15
20
BUNDLE_JOBS : 4
16
21
17
22
jobs :
18
23
specs :
24
+ timeout-minutes : 15
19
25
runs-on : ubuntu-latest
20
26
needs : diffend
21
27
strategy :
@@ -30,16 +36,19 @@ jobs:
30
36
- ruby : ' 3.4'
31
37
coverage : ' true'
32
38
steps :
33
- - uses : actions/checkout@v4
39
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
40
+ with :
41
+ fetch-depth : 0
42
+
34
43
- name : Install package dependencies
35
44
run : " [ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
36
45
37
- - name : Start Kafka with docker compose
46
+ - name : Start Kafka with Docker Compose
38
47
run : |
39
48
docker compose up -d || (sleep 5 && docker compose up -d)
40
49
41
50
- name : Set up Ruby
42
- uses : ruby/setup-ruby@v1
51
+ uses : ruby/setup-ruby@bbda85882f33075a3727c01e3c8d0de0be6146ce
43
52
with :
44
53
ruby-version : ${{matrix.ruby}}
45
54
bundler-cache : true
49
58
run : |
50
59
gem install bundler --no-document
51
60
gem update --system --no-document
52
-
53
61
bundle config set without 'tools benchmarks docs'
54
62
55
63
- name : Bundle install
58
66
bundle install --jobs 4 --retry 3
59
67
60
68
- name : Wait for Kafka
61
- run : |
62
- bundle exec bin/wait_for_kafka
69
+ run : bundle exec bin/wait_for_kafka
63
70
64
71
- name : Run all tests
65
72
env :
@@ -74,16 +81,17 @@ jobs:
74
81
run : bin/verify_topics_naming
75
82
76
83
diffend :
84
+ timeout-minutes : 5
77
85
runs-on : ubuntu-latest
78
86
strategy :
79
87
fail-fast : false
80
88
steps :
81
- - uses : actions/checkout@v4
89
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
82
90
with :
83
91
fetch-depth : 0
84
92
85
93
- name : Set up Ruby
86
- uses : ruby/setup-ruby@v1
94
+ uses : ruby/setup-ruby@bbda85882f33075a3727c01e3c8d0de0be6146ce
87
95
with :
88
96
ruby-version : 3.4
89
97
bundler-cache : true
@@ -95,33 +103,47 @@ jobs:
95
103
run : bundle secure
96
104
97
105
coditsu :
106
+ timeout-minutes : 5
98
107
runs-on : ubuntu-latest
99
108
strategy :
100
109
fail-fast : false
101
110
steps :
102
- - uses : actions/checkout@v4
111
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
103
112
with :
104
113
fetch-depth : 0
114
+ - name : Download Coditsu script
115
+ run : |
116
+ curl -sSL https://api.coditsu.io/run/ci -o coditsu_script.sh
117
+ chmod +x coditsu_script.sh
118
+ - name : Verify Coditsu script checksum
119
+ run : |
120
+ EXPECTED_SHA256="0aecc5aa010f53fca264548a41467a2b0a1208d750ce1da3e98a217304cacbbc"
121
+ ACTUAL_SHA256=$(sha256sum coditsu_script.sh | awk '{ print $1 }')
122
+ if [ "$ACTUAL_SHA256" != "$EXPECTED_SHA256" ]; then
123
+ echo "::error::Checksum verification failed. Expected $EXPECTED_SHA256 but got $ACTUAL_SHA256."
124
+ exit 1
125
+ fi
105
126
- name : Run Coditsu
106
127
env :
107
128
CODITSU_API_KEY : ${{ secrets.CODITSU_API_KEY }}
108
129
CODITSU_API_SECRET : ${{ secrets.CODITSU_API_SECRET }}
109
- run : \curl -sSL https://api.coditsu.io/run/ci | bash
110
-
130
+ run : ./coditsu_script.sh
111
131
112
132
assets :
133
+ timeout-minutes : 10
113
134
runs-on : ubuntu-latest
114
135
steps :
115
136
- name : Checkout code
116
- uses : actions/checkout@v4
137
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
117
138
118
139
- name : Set up Node.js
119
- uses : actions/setup-node@v4
140
+ uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
120
141
with :
121
142
node-version : ' 17'
143
+ cache : npm
122
144
123
145
- name : Cache node modules
124
- uses : actions/cache@v4
146
+ uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf
125
147
with :
126
148
path : ~/.npm
127
149
key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
0 commit comments