Skip to content

Commit 1fcee6a

Browse files
authored
Fix test-readme (#50)
* Fix test-readme Signed-off-by: Friedrich Gonzalez <[email protected]> * Add error Signed-off-by: Friedrich Gonzalez <[email protected]> * :ry again Signed-off-by: Friedrich Gonzalez <[email protected]> * Fix test Signed-off-by: Friedrich Gonzalez <[email protected]> * Remove unneeded Signed-off-by: Friedrich Gonzalez <[email protected]> * Really show content Signed-off-by: Friedrich Gonzalez <[email protected]> --------- Signed-off-by: Friedrich Gonzalez <[email protected]>
1 parent 47240d3 commit 1fcee6a

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
container: quay.io/cortexproject/cortex-jsonnet-build-image:e158eda
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
name: Checkout
1616
with:
1717
fetch-depth: 0
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
container: quay.io/cortexproject/cortex-jsonnet-build-image:e158eda
2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2929
name: Checkout
3030
with:
3131
fetch-depth: 0
@@ -36,10 +36,14 @@ jobs:
3636
runs-on: ubuntu-latest
3737
container: quay.io/cortexproject/cortex-jsonnet-build-image:e158eda
3838
steps:
39-
- uses: actions/checkout@v2
39+
- uses: actions/checkout@v4
4040
name: Checkout
4141
with:
4242
fetch-depth: 0
4343

44-
- name: "Test readme"
45-
run: make test-readme
44+
- name: "Test readme s3"
45+
run: make test-readme/s3
46+
- name: "Test readme azure"
47+
run: make test-readme/azure
48+
- name: "Test readme gcs"
49+
run: make test-readme/gcs

Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: lint build-image publish-build-image test-readme
1+
.PHONY: lint build-image publish-build-image test-readme clean
22

33
JSONNET_FMT := jsonnetfmt
44

@@ -47,18 +47,17 @@ build-mixin:
4747
test-readme: test-readme/azure test-readme/gcs test-readme/s3
4848

4949
test-readme/%:
50-
rm -rf $@ && \
51-
mkdir -p $@ && cd $@ && \
52-
tk init --k8s=1.24 && \
53-
jb install github.com/cortexproject/cortex-jsonnet/cortex@main && \
54-
rm -fr ./vendor/cortex && \
55-
cp -r ../../cortex ./vendor/ && \
56-
cp vendor/cortex/$(notdir $@)/main.jsonnet.example environments/default/main.jsonnet && \
57-
PAGER=cat tk show environments/default
50+
@./scripts/test-readme.sh $@
5851

5952
clean-white-noise:
6053
@$(FIND) . -type f -regextype posix-extended -regex '.*(md|libsonnet)' -print | \
6154
SED_BIN="$(SED)" xargs ./scripts/cleanup-white-noise.sh
6255

6356
check-white-noise: clean-white-noise
6457
@git diff --exit-code --quiet || (echo "Please remove trailing whitespaces running 'make clean-white-noise'" && false)
58+
59+
clean:
60+
rm -rf cortex-mixin/out
61+
rm -rf cortex-mixin/vendor
62+
rm -f cortex-mixin/cortex-mixin.zip
63+
rm -rf test-readme

scripts/test-readme.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -xe
3+
rm -rf $1
4+
mkdir -p $1
5+
cd $1
6+
tk init --k8s=1.26
7+
jb install github.com/cortexproject/cortex-jsonnet/cortex@main
8+
rm -fr ./vendor/cortex
9+
cp -r ../../cortex ./vendor/
10+
cp vendor/cortex/$(basename $1)/main.jsonnet.example environments/default/main.jsonnet
11+
PAGER=cat tk show --dangerous-allow-redirect environments/default

0 commit comments

Comments
 (0)