Skip to content

Commit 981484f

Browse files
Mr-Leshiystevenj
andauthored
feat(general): Bumping cat-ci version to v3.2.13 (#38)
* bump cat-ci version * intentionally break the test * add .secret.template update gitignore * wip * fix * try * try * prune cache for rust/+build target * try * try * try * try * try * disable caching for build * try new version * fix(rust): test (#40) * fix(rust): Add --keep-ts like the original cache fix had. Also, use a common builder. * refactor(rust): Move FINGERPRINT_SRC to the common rust definitions in cat-ci * fix(rust): Remove deliberate cache break * ci(general): Bump to latest CI release with updated rust builders * remove failed test * add failing test again * disable caching for build target * Revert "disable caching for build target" This reverts commit 3c77acb. * fix(rust): Try Rust cache fix * fix(rust): remove broken unit test test * test(rust): Put the failing unit test test back * fix(rust): Bump to cat-ci v3.2.12 * remove failed test * Change advisories to warnings, because they randomly break CI and we can't control them. * fix(rust): Use v3.2.13 of cat-ci --------- Co-authored-by: Steven Johnson <[email protected]> Co-authored-by: Steven Johnson <[email protected]>
1 parent 833474f commit 981484f

File tree

8 files changed

+63
-20
lines changed

8 files changed

+63
-20
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Secrets
2+
**/.secret
3+
14
### Linux ###
25
*~
36

.secret.template

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GITHUB_TOKEN=Make One at https://github.com/settings/tokens only need public repo, read packages permissions

Earthfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.05 AS mdlint-ci
4-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.05 AS cspell-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.13 AS mdlint-ci
4+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.13 AS cspell-ci
55

66
FROM debian:stable-slim
77

docs/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.05 AS docs-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.13 AS docs-ci
44

55
IMPORT .. AS repo
66

rust/Earthfile

+53-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.05 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.13 AS rust-ci
4+
5+
COPY_SRC:
6+
FUNCTION
7+
8+
COPY --keep-ts --dir \
9+
Cargo.toml clippy.toml deny.toml rustfmt.toml \
10+
.cargo .config \
11+
c509-certificate \
12+
cardano-chain-follower \
13+
catalyst-voting \
14+
cbork cbork-abnf-parser cbork-cddl-parser \
15+
hermes-ipfs \
16+
.
417

518
# sync-cfg: Synchronize local config with CI version.
619
# Must be run by the developer manually.
@@ -9,27 +22,31 @@ sync-cfg:
922

1023
# builder : Set up our target toolchains, and copy our files.
1124
builder:
12-
DO rust-ci+SETUP
13-
14-
COPY Cargo.toml clippy.toml deny.toml rustfmt.toml .
15-
COPY --dir .cargo .config \
16-
c509-certificate \
17-
cardano-chain-follower \
18-
catalyst-voting \
19-
cbork \
20-
cbork-abnf-parser \
21-
cbork-cddl-parser \
22-
hermes-ipfs .
25+
DO rust-ci+SETUP
26+
27+
builder-src:
28+
FROM +builder
29+
30+
# Don't build the src in the home directory itself, because it contains stuff.
31+
WORKDIR $HOME/build
32+
RUN rm -rf *
33+
34+
# Cached copy of the source we build.
35+
DO +COPY_SRC
36+
37+
# Generate Checksums of the source
38+
DO rust-ci+FINGERPRINT_SRC
39+
SAVE ARTIFACT ../src_fingerprint.txt
2340

2441
# check : Run basic check.
2542
check:
26-
FROM +builder
43+
FROM +builder-src
2744

2845
DO rust-ci+EXECUTE --cmd="/scripts/std_checks.py"
2946

3047
# build : Build crates.
3148
build:
32-
FROM +builder
49+
FROM +builder-src
3350

3451
DO rust-ci+EXECUTE \
3552
--cmd="/scripts/std_build.py" \
@@ -43,6 +60,28 @@ build:
4360
SAVE ARTIFACT target/$TARGETARCH/doc doc
4461
SAVE ARTIFACT target/release/cbork cbork
4562

63+
# build-src-check: Check for any caching issues with the source we are building against.
64+
check-builder-src-cache:
65+
FROM +builder
66+
67+
# Don't build the src in the home directory itself, because it contains stuff.
68+
WORKDIR $HOME/build
69+
RUN rm -rf *
70+
71+
COPY +builder-src/src_fingerprint.txt ..
72+
73+
RUN --no-cache echo "Cache Disabled"
74+
75+
# Uncached copy of the source we build.
76+
DO +COPY_SRC
77+
78+
# Generate Checksums of the source
79+
DO rust-ci+FINGERPRINT_SRC --FINGERPRINT=src_fingerprint_uncached.txt
80+
81+
RUN diff ../src_fingerprint.txt ../src_fingerprint_uncached.txt \
82+
|| (echo "ERROR: Source fingerprints do not match. Caching Error Detected!!" && exit 1) \
83+
&& echo "Source fingerprints match. Caching OK."
84+
4685

4786
# local-ci-run: This step simulates the full CI run for local purposes only.
4887
local-ci-run:

rust/Justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sync-cfg:
1717

1818
# Check Dependency licenses and CVE's
1919
license-check:
20-
cargo deny check --exclude-dev
20+
cargo deny check --exclude-dev -W vulnerability
2121

2222
# Format the rust code
2323
code-format:

rust/c509-certificate/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.05 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.13 AS rust-ci
44

55
IMPORT .. AS rust-local
66
IMPORT ../.. AS repo

rust/cbork/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.05 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.13 AS rust-ci
44

55
IMPORT .. AS rust-local
66

0 commit comments

Comments
 (0)