Skip to content

Commit

Permalink
ci: add more pkg e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Oct 16, 2024
1 parent b720c0d commit cbf9ecb
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 36 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ jobs:
- name: Build Package
run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar

- name: Push Latest Package to Upbound
if: env.XPKG_ACCESS_ID != ''
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:latest"

- name: Start Function Server
run: |
go run . --insecure --debug &
sleep 10
- name: Run e2e Tests
run: export PATH=$PATH:$PWD && scripts/e2e.sh

- name: Upload Single-Platform Package
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -166,7 +178,3 @@ jobs:
- name: Push Multi-Platform Package to Upbound
if: env.XPKG_ACCESS_ID != ''
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"

- name: Push Latest Package to Upbound
if: env.XPKG_ACCESS_ID != ''
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:latest"
32 changes: 0 additions & 32 deletions .github/workflows/e2e.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions examples/default/resources/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
run:
crossplane render xr.yaml composition.yaml functions.yaml -r

run-in-docker:
crossplane render xr.yaml composition.yaml functions.yaml -r
6 changes: 6 additions & 0 deletions examples/default/resources/functions-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: kcl-function
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
6 changes: 6 additions & 0 deletions scripts/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ find examples -type f -name "Makefile" -exec sh -c '
make
' \;

find examples -type f -name "Makefile" -exec sh -c '
dir="{}"
cd "$(dirname "$dir")" || exit
make run-in-docker
' \;

find examples_kcl -type f -name "Makefile" -exec sh -c '
dir="{}"
cd "$(dirname "$dir")" || exit
Expand Down

0 comments on commit cbf9ecb

Please sign in to comment.