Skip to content

Commit

Permalink
Fix test-readme
Browse files Browse the repository at this point in the history
Signed-off-by: Friedrich Gonzalez <[email protected]>
  • Loading branch information
friedrichg committed May 9, 2024
1 parent 9cc367f commit 594a36c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,21 +25,17 @@ 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
readme:
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
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 | \
Expand Down
11 changes: 11 additions & 0 deletions scripts/test-readme.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 594a36c

Please sign in to comment.