diff --git a/.gitignore b/.gitignore index 335f4c371ac..e881c8d539e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +## Secrets +**/.secret + ### Linux ### *~ diff --git a/.secret.template b/.secret.template new file mode 100644 index 00000000000..072b7c4f22c --- /dev/null +++ b/.secret.template @@ -0,0 +1 @@ +GITHUB_TOKEN=Make One at https://github.com/settings/tokens only need public repo, read packages permissions diff --git a/Earthfile b/Earthfile index 9c23625d306..30f00065c51 100644 --- a/Earthfile +++ b/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.05 AS mdlint-ci -IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.05 AS cspell-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.13 AS mdlint-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.13 AS cspell-ci FROM debian:stable-slim diff --git a/docs/Earthfile b/docs/Earthfile index 52ac889536a..09766872cf2 100644 --- a/docs/Earthfile +++ b/docs/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.05 AS docs-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.13 AS docs-ci IMPORT .. AS repo diff --git a/rust/Earthfile b/rust/Earthfile index cd1d38dfe02..00a26b0f4fe 100644 --- a/rust/Earthfile +++ b/rust/Earthfile @@ -1,6 +1,19 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.05 AS rust-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.13 AS rust-ci + +COPY_SRC: + FUNCTION + + COPY --keep-ts --dir \ + Cargo.toml clippy.toml deny.toml rustfmt.toml \ + .cargo .config \ + c509-certificate \ + cardano-chain-follower \ + catalyst-voting \ + cbork cbork-abnf-parser cbork-cddl-parser \ + hermes-ipfs \ + . # sync-cfg: Synchronize local config with CI version. # Must be run by the developer manually. @@ -9,27 +22,31 @@ sync-cfg: # builder : Set up our target toolchains, and copy our files. builder: - DO rust-ci+SETUP - - COPY Cargo.toml clippy.toml deny.toml rustfmt.toml . - COPY --dir .cargo .config \ - c509-certificate \ - cardano-chain-follower \ - catalyst-voting \ - cbork \ - cbork-abnf-parser \ - cbork-cddl-parser \ - hermes-ipfs . + DO rust-ci+SETUP + +builder-src: + FROM +builder + + # Don't build the src in the home directory itself, because it contains stuff. + WORKDIR $HOME/build + RUN rm -rf * + + # Cached copy of the source we build. + DO +COPY_SRC + + # Generate Checksums of the source + DO rust-ci+FINGERPRINT_SRC + SAVE ARTIFACT ../src_fingerprint.txt # check : Run basic check. check: - FROM +builder + FROM +builder-src DO rust-ci+EXECUTE --cmd="/scripts/std_checks.py" # build : Build crates. build: - FROM +builder + FROM +builder-src DO rust-ci+EXECUTE \ --cmd="/scripts/std_build.py" \ @@ -43,6 +60,28 @@ build: SAVE ARTIFACT target/$TARGETARCH/doc doc SAVE ARTIFACT target/release/cbork cbork +# build-src-check: Check for any caching issues with the source we are building against. +check-builder-src-cache: + FROM +builder + + # Don't build the src in the home directory itself, because it contains stuff. + WORKDIR $HOME/build + RUN rm -rf * + + COPY +builder-src/src_fingerprint.txt .. + + RUN --no-cache echo "Cache Disabled" + + # Uncached copy of the source we build. + DO +COPY_SRC + + # Generate Checksums of the source + DO rust-ci+FINGERPRINT_SRC --FINGERPRINT=src_fingerprint_uncached.txt + + RUN diff ../src_fingerprint.txt ../src_fingerprint_uncached.txt \ + || (echo "ERROR: Source fingerprints do not match. Caching Error Detected!!" && exit 1) \ + && echo "Source fingerprints match. Caching OK." + # local-ci-run: This step simulates the full CI run for local purposes only. local-ci-run: diff --git a/rust/Justfile b/rust/Justfile index 8d7081123fe..abddacc2617 100644 --- a/rust/Justfile +++ b/rust/Justfile @@ -17,7 +17,7 @@ sync-cfg: # Check Dependency licenses and CVE's license-check: - cargo deny check --exclude-dev + cargo deny check --exclude-dev -W vulnerability # Format the rust code code-format: diff --git a/rust/c509-certificate/Earthfile b/rust/c509-certificate/Earthfile index 44a647647d3..80af451c187 100644 --- a/rust/c509-certificate/Earthfile +++ b/rust/c509-certificate/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.05 AS rust-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.13 AS rust-ci IMPORT .. AS rust-local IMPORT ../.. AS repo diff --git a/rust/cbork/Earthfile b/rust/cbork/Earthfile index cd618f89ea7..bc0dd2c19d2 100644 --- a/rust/cbork/Earthfile +++ b/rust/cbork/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.05 AS rust-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.13 AS rust-ci IMPORT .. AS rust-local