From 838a241dc805b9026ab9125e31de33499d0bf308 Mon Sep 17 00:00:00 2001 From: peefy Date: Thu, 15 Aug 2024 17:25:47 +0800 Subject: [PATCH] ci: add image e2e tests Signed-off-by: peefy --- .github/workflows/ci.yaml | 2 +- .github/workflows/example-e2e-tests.yaml | 6 ++--- .github/workflows/image-e2e-tests.yaml | 30 ++++++++++++++++++++++++ Dockerfile | 2 +- 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/image-e2e-tests.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a2e402d..fba4fd5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Go 1.22 + - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod diff --git a/.github/workflows/example-e2e-tests.yaml b/.github/workflows/example-e2e-tests.yaml index cc25c11..8dc9df1 100644 --- a/.github/workflows/example-e2e-tests.yaml +++ b/.github/workflows/example-e2e-tests.yaml @@ -1,4 +1,4 @@ -name: example-e2e-test +name: example-e2e-tests on: pull_request: branches: @@ -22,7 +22,7 @@ jobs: shell: bash -ieo pipefail {0} run: PATH=$PATH:$HOME/go/bin ./examples/test.sh - - name: run concurrent e2e + - name: Run concurrent e2e tests run: PATH=$PATH:$HOME/go/bin ./scripts/concurrent_test.sh macos: @@ -46,7 +46,7 @@ jobs: shell: bash -ieo pipefail {0} run: PATH=$PATH:$HOME/go/bin ./examples/test.sh - - name: run concurrent e2e + - name: Run concurrent e2e tests run: PATH=$PATH:$HOME/go/bin ./scripts/concurrent_test.sh windows: diff --git a/.github/workflows/image-e2e-tests.yaml b/.github/workflows/image-e2e-tests.yaml new file mode 100644 index 0000000..80c90e5 --- /dev/null +++ b/.github/workflows/image-e2e-tests.yaml @@ -0,0 +1,30 @@ +name: image-e2e-tests +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build-and-test: + name: Test + runs-on: ubuntu-latest + container: + image: kcllang/kcl + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - name: Install dependencies + run: apt-get install make + - name: Example tests + run: ./examples/test.sh + - name: Run concurrent e2e tests + run: ./scripts/concurrent_test.sh diff --git a/Dockerfile b/Dockerfile index 115bfd3..c9a5af5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ ARG TARGETARCH COPY --from=build /src/bin/kcl /usr/local/bin/kcl RUN /usr/local/bin/kcl RUN cp -r /root/go/bin/* /usr/local/bin/ -RUN apt-get update && apt-get install gcc git -y && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install gcc make git -y && rm -rf /var/lib/apt/lists/* # The reason for doing this below is to prevent the # container from not having write permissions. ENV KCL_PKG_PATH=/tmp