From 594a36cd38a2c7b74758a8953f8cdc50ad3e8ef9 Mon Sep 17 00:00:00 2001 From: Friedrich Gonzalez Date: Thu, 9 May 2024 16:52:59 +0200 Subject: [PATCH] Fix test-readme Signed-off-by: Friedrich Gonzalez --- .github/workflows/ci.yaml | 10 +++------- Makefile | 9 +-------- scripts/test-readme.sh | 11 +++++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) create mode 100755 scripts/test-readme.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fa49025d..d8038973 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest container: quay.io/cortexproject/cortex-jsonnet-build-image:e158eda steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 name: Checkout with: fetch-depth: 0 @@ -25,10 +25,8 @@ jobs: runs-on: ubuntu-latest container: quay.io/cortexproject/cortex-jsonnet-build-image:e158eda steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 name: Checkout - with: - fetch-depth: 0 - name: "Build mixin" run: make build-mixin @@ -36,10 +34,8 @@ jobs: runs-on: ubuntu-latest container: quay.io/cortexproject/cortex-jsonnet-build-image:e158eda steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 name: Checkout - with: - fetch-depth: 0 - name: "Test readme" run: make test-readme diff --git a/Makefile b/Makefile index 3b1f77d1..c94e80e7 100644 --- a/Makefile +++ b/Makefile @@ -47,14 +47,7 @@ build-mixin: test-readme: test-readme/azure test-readme/gcs test-readme/s3 test-readme/%: - rm -rf $@ && \ - mkdir -p $@ && cd $@ && \ - tk init --k8s=1.24 && \ - jb install github.com/cortexproject/cortex-jsonnet/cortex@main && \ - rm -fr ./vendor/cortex && \ - cp -r ../../cortex ./vendor/ && \ - cp vendor/cortex/$(notdir $@)/main.jsonnet.example environments/default/main.jsonnet && \ - PAGER=cat tk show environments/default + @./scripts/test-readme.sh $@ clean-white-noise: @$(FIND) . -type f -regextype posix-extended -regex '.*(md|libsonnet)' -print | \ diff --git a/scripts/test-readme.sh b/scripts/test-readme.sh new file mode 100755 index 00000000..11eb966f --- /dev/null +++ b/scripts/test-readme.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e +rm -rf $1 +mkdir -p $1 +cd $1 +tk init --k8s=1.26 +jb install github.com/cortexproject/cortex-jsonnet/cortex@main +rm -fr ./vendor/cortex +cp -r ../../cortex ./vendor/ +cp vendor/cortex/$(basename $1)/main.jsonnet.example environments/default/main.jsonnet +PAGER=cat tk show environments/default