@@ -2,181 +2,181 @@ name: ci
22on :
33 pull_request :
44 branches :
5- - main
5+ - main
66 push :
77 branches :
8- - main
8+ - main
99jobs :
10- test :
10+ fmt :
1111 runs-on : ubuntu-latest
1212 steps :
13- - name : Checkout code
14- uses : actions/checkout@v4
15- - id : calculate_hash
16- name : Calculate source file hash
17- run : |-
18- set -e
19- echo 'Calculating source file hash...'
20- TEMP_HASH_FILE="/tmp/source_files_for_hash"
21- rm -f "$TEMP_HASH_FILE"
22-
23- find . -path './src/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
24- find . -path './Cargo.toml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
25- find . -path './Cargo.lock' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
26- find . -path './tests/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
27- find . -path './tests/**/*.yml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
28- find . -path './tests/**/*.trycmd' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
29- find . -path './examples/**/*.yml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
30- find . -path './examples/**/*.yaml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+ - id : calculate_hash
16+ name : Calculate source file hash
17+ run : |-
18+ set -e
19+ echo 'Calculating source file hash...'
20+ TEMP_HASH_FILE="/tmp/source_files_for_hash"
21+ rm -f "$TEMP_HASH_FILE"
3122
32- if [ -s "$TEMP_HASH_FILE" ]; then
33- # Calculate hash of file contents
34- JOB_HASH=$(xargs -I{{}} sh -c 'cat "{{}}"' < "$TEMP_HASH_FILE" | sha256sum | cut -d' ' -f1)
35- echo "Hash calculated: $JOB_HASH"
36- echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
37- else
38- JOB_HASH="empty"
39- echo "No source files found, using empty hash"
40- echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
41- fi
42- shell : bash
43- - id : check_skip
44- name : Check if job should be skipped
45- run : |-
46- set -e
47- SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
48- SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
23+ find . -path './src/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
24+ find . -path './Cargo.toml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
25+ find . -path './Cargo.lock' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
4926
50- if [ -f "$SKIP_MARKER" ]; then
51- echo "✓ Job already completed successfully for this file hash. Skipping..."
52- exit 0
53- else
54- echo "→ No previous successful run found. Proceeding with job..."
55- mkdir -p "$SKIP_CACHE_DIR"
56- fi
57- shell : bash
58- - name : Run tests
59- run : cargo test --all-features
60- - id : record_completion
61- name : Record job completion
62- run : |-
63- set -e
64- SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
65- SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
27+ if [ -s "$TEMP_HASH_FILE" ]; then
28+ # Calculate hash of file contents
29+ JOB_HASH=$(xargs -I{{}} sh -c 'cat "{{}}"' < "$TEMP_HASH_FILE" | sha256sum | cut -d' ' -f1)
30+ echo "Hash calculated: $JOB_HASH"
31+ echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
32+ else
33+ JOB_HASH="empty"
34+ echo "No source files found, using empty hash"
35+ echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
36+ fi
37+ shell : bash
38+ - id : check_skip
39+ name : Check if job should be skipped
40+ run : |-
41+ set -e
42+ SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
43+ SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
6644
67- echo "Recording successful completion for hash ${{JOB_HASH}}"
45+ if [ -f "$SKIP_MARKER" ]; then
46+ echo "✓ Job already completed successfully for this file hash. Skipping..."
47+ exit 0
48+ else
49+ echo "→ No previous successful run found. Proceeding with job..."
6850 mkdir -p "$SKIP_CACHE_DIR"
69- echo "$(date): Job completed successfully" > "$SKIP_MARKER"
70- shell : bash
51+ fi
52+ shell : bash
53+ - name : Format check
54+ run : cargo fmt -- --check
55+ - id : record_completion
56+ name : Record job completion
57+ run : |-
58+ set -e
59+ SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
60+ SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
61+
62+ echo "Recording successful completion for hash ${{JOB_HASH}}"
63+ mkdir -p "$SKIP_CACHE_DIR"
64+ echo "$(date): Job completed successfully" > "$SKIP_MARKER"
65+ shell : bash
7166 clippy :
7267 runs-on : ubuntu-latest
7368 steps :
74- - name : Checkout code
75- uses : actions/checkout@v4
76- - id : calculate_hash
77- name : Calculate source file hash
78- run : |-
79- set -e
80- echo 'Calculating source file hash...'
81- TEMP_HASH_FILE="/tmp/source_files_for_hash"
82- rm -f "$TEMP_HASH_FILE"
83-
84- find . -path './src/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
85- find . -path './Cargo.toml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
86- find . -path './Cargo.lock' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
69+ - name : Checkout code
70+ uses : actions/checkout@v4
71+ - id : calculate_hash
72+ name : Calculate source file hash
73+ run : |-
74+ set -e
75+ echo 'Calculating source file hash...'
76+ TEMP_HASH_FILE="/tmp/source_files_for_hash"
77+ rm -f "$TEMP_HASH_FILE"
8778
88- if [ -s "$TEMP_HASH_FILE" ]; then
89- # Calculate hash of file contents
90- JOB_HASH=$(xargs -I{{}} sh -c 'cat "{{}}"' < "$TEMP_HASH_FILE" | sha256sum | cut -d' ' -f1)
91- echo "Hash calculated: $JOB_HASH"
92- echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
93- else
94- JOB_HASH="empty"
95- echo "No source files found, using empty hash"
96- echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
97- fi
98- shell : bash
99- - id : check_skip
100- name : Check if job should be skipped
101- run : |-
102- set -e
103- SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
104- SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
79+ find . -path './src/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
80+ find . -path './Cargo.toml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
81+ find . -path './Cargo.lock' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
10582
106- if [ -f "$SKIP_MARKER" ]; then
107- echo "✓ Job already completed successfully for this file hash. Skipping..."
108- exit 0
109- else
110- echo "→ No previous successful run found. Proceeding with job..."
111- mkdir -p "$SKIP_CACHE_DIR"
112- fi
113- shell : bash
114- - name : Clippy check
115- run : cargo clippy --all-targets --all-features -- -D warnings
116- - id : record_completion
117- name : Record job completion
118- run : |-
119- set -e
120- SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
121- SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
83+ if [ -s "$TEMP_HASH_FILE" ]; then
84+ # Calculate hash of file contents
85+ JOB_HASH=$(xargs -I{{}} sh -c 'cat "{{}}"' < "$TEMP_HASH_FILE" | sha256sum | cut -d' ' -f1)
86+ echo "Hash calculated: $JOB_HASH"
87+ echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
88+ else
89+ JOB_HASH="empty"
90+ echo "No source files found, using empty hash"
91+ echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
92+ fi
93+ shell : bash
94+ - id : check_skip
95+ name : Check if job should be skipped
96+ run : |-
97+ set -e
98+ SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
99+ SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
122100
123- echo "Recording successful completion for hash ${{JOB_HASH}}"
101+ if [ -f "$SKIP_MARKER" ]; then
102+ echo "✓ Job already completed successfully for this file hash. Skipping..."
103+ exit 0
104+ else
105+ echo "→ No previous successful run found. Proceeding with job..."
124106 mkdir -p "$SKIP_CACHE_DIR"
125- echo "$(date): Job completed successfully" > "$SKIP_MARKER"
126- shell : bash
127- fmt :
107+ fi
108+ shell : bash
109+ - name : Clippy check
110+ run : cargo clippy --all-targets --all-features -- -D warnings
111+ - id : record_completion
112+ name : Record job completion
113+ run : |-
114+ set -e
115+ SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
116+ SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
117+
118+ echo "Recording successful completion for hash ${{JOB_HASH}}"
119+ mkdir -p "$SKIP_CACHE_DIR"
120+ echo "$(date): Job completed successfully" > "$SKIP_MARKER"
121+ shell : bash
122+ test :
128123 runs-on : ubuntu-latest
129124 steps :
130- - name : Checkout code
131- uses : actions/checkout@v4
132- - id : calculate_hash
133- name : Calculate source file hash
134- run : |-
135- set -e
136- echo 'Calculating source file hash...'
137- TEMP_HASH_FILE="/tmp/source_files_for_hash"
138- rm -f "$TEMP_HASH_FILE"
125+ - name : Checkout code
126+ uses : actions/checkout@v4
127+ - id : calculate_hash
128+ name : Calculate source file hash
129+ run : |-
130+ set -e
131+ echo 'Calculating source file hash...'
132+ TEMP_HASH_FILE="/tmp/source_files_for_hash"
133+ rm -f "$TEMP_HASH_FILE"
139134
140- find . -path './src/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
141- find . -path './Cargo.toml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
142- find . -path './Cargo.lock' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
135+ find . -path './src/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
136+ find . -path './Cargo.toml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
137+ find . -path './Cargo.lock' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
138+ find . -path './tests/**/*.rs' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
139+ find . -path './tests/**/*.yml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
140+ find . -path './tests/**/*.trycmd' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
141+ find . -path './examples/**/*.yml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
142+ find . -path './examples/**/*.yaml' -type f 2>/dev/null | sort >> "$TEMP_HASH_FILE" || true
143143
144- if [ -s "$TEMP_HASH_FILE" ]; then
145- # Calculate hash of file contents
146- JOB_HASH=$(xargs -I{{}} sh -c 'cat "{{}}"' < "$TEMP_HASH_FILE" | sha256sum | cut -d' ' -f1)
147- echo "Hash calculated: $JOB_HASH"
148- echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
149- else
150- JOB_HASH="empty"
151- echo "No source files found, using empty hash"
152- echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
153- fi
154- shell : bash
155- - id : check_skip
156- name : Check if job should be skipped
157- run : |-
158- set -e
159- SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
160- SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
144+ if [ -s "$TEMP_HASH_FILE" ]; then
145+ # Calculate hash of file contents
146+ JOB_HASH=$(xargs -I{{}} sh -c 'cat "{{}}"' < "$TEMP_HASH_FILE" | sha256sum | cut -d' ' -f1)
147+ echo "Hash calculated: $JOB_HASH"
148+ echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
149+ else
150+ JOB_HASH="empty"
151+ echo "No source files found, using empty hash"
152+ echo "JOB_HASH=$JOB_HASH" >> $GITHUB_ENV
153+ fi
154+ shell : bash
155+ - id : check_skip
156+ name : Check if job should be skipped
157+ run : |-
158+ set -e
159+ SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
160+ SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
161161
162- if [ -f "$SKIP_MARKER" ]; then
163- echo "✓ Job already completed successfully for this file hash. Skipping..."
164- exit 0
165- else
166- echo "→ No previous successful run found. Proceeding with job..."
167- mkdir -p "$SKIP_CACHE_DIR"
168- fi
169- shell : bash
170- - name : Format check
171- run : cargo fmt -- --check
172- - id : record_completion
173- name : Record job completion
174- run : |-
175- set -e
176- SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
177- SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
178-
179- echo "Recording successful completion for hash ${{JOB_HASH}}"
162+ if [ -f "$SKIP_MARKER" ]; then
163+ echo "✓ Job already completed successfully for this file hash. Skipping..."
164+ exit 0
165+ else
166+ echo "→ No previous successful run found. Proceeding with job..."
180167 mkdir -p "$SKIP_CACHE_DIR"
181- echo "$(date): Job completed successfully" > "$SKIP_MARKER"
182- shell : bash
168+ fi
169+ shell : bash
170+ - name : Run tests
171+ run : cargo test --all-features
172+ - id : record_completion
173+ name : Record job completion
174+ run : |-
175+ set -e
176+ SKIP_CACHE_DIR="/tmp/cigen_skip_cache"
177+ SKIP_MARKER="$SKIP_CACHE_DIR/job_${{JOB_HASH}}_amd64"
178+
179+ echo "Recording successful completion for hash ${{JOB_HASH}}"
180+ mkdir -p "$SKIP_CACHE_DIR"
181+ echo "$(date): Job completed successfully" > "$SKIP_MARKER"
182+ shell : bash
0 commit comments