forked from glasskube/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add action to test package installation [WIP]
Signed-off-by: Jakob Steiner <[email protected]>
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Test package installation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- packages/** | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Git diff | ||
id: diff | ||
run: echo "changes=$(git diff --name-only HEAD~1 | grep -E "packages/[^/]+/[^/]+/.+" | cut -d / -f 2,3 -s | sort | uniq | jq -cnR '[inputs | split("/")]')" >> $GITHUB_OUTPUT | ||
outputs: | ||
changes: ${{ steps.diff.outputs.changes }} | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- setup | ||
if: needs.setup.outputs.changes != '[]' | ||
strategy: | ||
matrix: | ||
change: ${{ fromJson(needs.setup.outputs.changes) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
- name: Get latest Glasskube version | ||
id: version | ||
run: echo "version=$(curl https://glasskube.dev/release.json | jq -r .version)" >> $GITHUB_OUTPUT | ||
- name: Install glasskube | ||
run: curl -fL https://github.com/glasskube/glasskube/releases/download/v${{ steps.version.outputs.version }}/glasskube_v${{ steps.version.outputs.version }}_linux_x86_64.tar.gz | tar -xz | ||
- name: Check glasskube | ||
run: ./glasskube --version | ||
- name: Start local webserver | ||
uses: Eun/http-server-action@v1 | ||
with: | ||
directory: ${{ github.workspace }} | ||
port: 9090 | ||
- name: Start minikube cluster | ||
uses: medyagh/setup-minikube@317d92317e473a10540357f1f4b2878b80ee7b95 # v0.0.16 | ||
- name: Bootstrap Glasskube in Minikube cluster | ||
run: ./glasskube bootstrap --disable-telemetry --create-default-repository=false | ||
- name: Add local repository | ||
run: ./glasskube repo add local --url=http://host.minikube.internal:9090/packages/ --default | ||
- run: curl -v http://localhost:9090/packages/${{ matrix.change[0] }}/${{ matrix.change[1] }}/package.yaml | ||
- name: Install package in Minikube cluster | ||
run: ./glasskube install ${{ matrix.change[0] }} --repository=local --version=${{ matrix.change[1] }} --yes |