Skip to content

Manual Flow Testing #22

Manual Flow Testing

Manual Flow Testing #22

Workflow file for this run

name: Manual Flow Testing
on: workflow_dispatch
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
languages: ${{ steps.get-matrix.outputs.languages }}
env:
FUNC_VERSION: "knative-v1.16.1"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install func
uses: gauron99/knative-func-action@main
with:
version: ${{ env.FUNC_VERSION }}
name: f
- name: Get Matrix
id: get-matrix
run: |
WORKDIR=$(mktemp -d)
cd $WORKDIR
echo "did the cd work?"
pwd
## NOTE: ls -d returns absolute path
## GITHUB_WORKSPACE is the root directory
languages="{\"new\":["
languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')"
languages+="]}"
echo "TO MATRIX:$languages"
echo languages=languages >> $GITHUB_OUTPUT
deploy:
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
language: ${{ fromJSON(needs.prepare.outputs.languages) }}
env:
ACTIONS_STEP_DEBUG: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Functions
run: |
lang=$(basename "$lang_dir_abs")
echo "Building funcs in language $lang"
for template_dir_abs in $(ls -d $lang_dir_abs*/); do
echo "ls -la"
ls -la
echo "pwd"
pwd
echo "ls -la ${GITHUB_WORKSPACE}"
ls -la ${GITHUB_WORKSPACE}
template=$(basename "$template_dir_abs")
echo "f create $lang-$template -r=$url -l=$lang -t=$template"
f create $lang-$template -r "$url" -l "$lang" -t "$template"
#FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f done