PiT feat: more versatile options for the control-center (#25) * feat: more versatile options for the control-center * reduce presets * detect better whether CC chart is installed * remove redundant parameters that can be done by using CC_TESTS env var * show which version of CC is using the app #365
This file contains hidden or 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
name: Run PiT | |
run-name: PiT ${{ inputs.version }} ${{ inputs.vendor }} ${{inputs.skipcurrent}} ${{inputs.starters}} ${{github.event_path}} ${{ github.event.head_commit.message }} | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: false | |
type: string | |
starters: | |
description: 'Starters to run, separated by comma' | |
required: true | |
type: string | |
vendor: | |
description: 'Kubernetes vendor to use with CC' | |
required: false | |
type: string | |
skipcurrent: | |
description: 'Skip running tests in current version' | |
required: false | |
type: boolean | |
default: false | |
skipdev: | |
description: 'Skip running tests in dev mode' | |
required: false | |
type: boolean | |
default: false | |
debug: | |
description: 'Be verbose when running PiT steps' | |
required: false | |
type: boolean | |
default: false | |
push: | |
env: | |
CC_KEY: ${{secrets.CC_KEY}} | |
CC_CERT: ${{secrets.CC_CERT}} | |
GITHUB_TOKEN: ${{secrets.GHTK}} | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
services: | |
docker: | |
image: docker:dind | |
options: --privileged --shm-size=2g | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dev-hanz-ops/install-gh-cli-action@v0.2.1 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- uses: stCarolas/setup-maven@v5 | |
with: | |
maven-version: '3.9.0' | |
- uses: azure/setup-helm@v3.5 | |
with: | |
version: 3.17.3 | |
- if: ${{env.ACT}} | |
name: Run install dependencies (only in ACT) | |
run: | | |
for i in PATH CC_KEY CC_CERT GITHUB_TOKEN | |
do | |
V="${!i}" | |
[ -n "$V" ] && echo "export $i='"$V"'" >> vars.sh | |
done | |
sudo apt-get update -qq | |
sudo apt-get install -qq -y vim iputils-ping curl >/dev/null | |
sudo chmod u+s /usr/bin/docker | |
shell: bash | |
- name: Run Install licenses | |
run: | | |
[ -z "${{secrets.TB_LICENSE}}" ] && echo "TB_LICENSE is not set" && exit 1 | |
mkdir -p ~/.vaadin/ | |
echo '{"username":"'`echo ${{secrets.TB_LICENSE}} | cut -d / -f1`'","proKey":"'`echo ${{secrets.TB_LICENSE}} | cut -d / -f2`'"}' > ~/.vaadin/proKey | |
echo "${{secrets.SS_LICENSE}}" > ~/vaadin.spreadsheet.developer.license | |
shell: bash | |
- name: Run Compute Arguments | |
run: | | |
[ true = "${{inputs.skipcurrent}}" ] && A="$A --skip-current" | |
[ true = "${{inputs.skipdev}}" ] && A="$A --skip-dev" | |
[ true = "${{inputs.debug}}" ] && A="$A --debug" | |
[ -n "${{inputs.version}}" ] && A="$A --version=${{inputs.version}}" || A="$A --version=24.8-SNAPSHOT" | |
[ -n "${{inputs.starters}}" ] && A="$A --starters=${{inputs.starters}}" || A="$A --starters=control-center" | |
[ -n "${{inputs.vendor}}" ] && A="$A --vendor=${{inputs.vendor}}" | |
echo "PIT_ARGS=$A" >> $GITHUB_ENV | |
K=`echo "$A" | perl -pe 's/[^\d\w]/-/g' | tr -s '-'` | |
echo "CACHE_KEY=$K" >> $GITHUB_ENV | |
shell: bash | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.m2/repository | |
~/.npm | |
key: pit-${{env.CACHE_KEY}} | |
restore-keys: | | |
pit-${{env.CACHE_KEY}} | |
pit- | |
- if: ${{!inputs.vendor || inputs.vendor == 'kind'}} | |
uses: helm/kind-action@v1 | |
with: | |
cluster_name: pit | |
- if: ${{inputs.vendor == 'do'}} | |
uses: azure/setup-kubectl@v4 | |
- if: ${{inputs.vendor == 'do'}} | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DOTK }} | |
- name: Run PiT | |
run: | | |
echo ./scripts/pit/run.sh ${{env.PIT_ARGS}} | |
./scripts/pit/run.sh ${{env.PIT_ARGS}} --test | |
./scripts/pit/run.sh ${{env.PIT_ARGS}} | |
shell: bash | |
# - if: ${{failure()}} | |
# name: Setup upterm session | |
# uses: lhotari/action-upterm@v1 | |
# with: | |
# limit-access-to-actor: true | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GHTK }} | |
- if: ${{always()}} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: outputs | |
path: tmp/**/*.out | |
if-no-files-found: ignore | |
retention-days: 2 | |
- name: Run Delete Previous Cache | |
continue-on-error: true | |
run: | | |
gh extension install actions/gh-actions-cache | |
gh actions-cache list | |
gh actions-cache delete "pit-${{env.CACHE_KEY}}" --confirm || true | |
shell: bash | |