Skip to content

Manual Flow Testing #36

Manual Flow Testing

Manual Flow Testing #36

name: Manual Flow Testing
on: workflow_dispatch
jobs:
builds:
runs-on: ubuntu-latest
env:
VERSION: "v1.15.1"
ACTIONS_STEP_DEBUG: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install func
run: |
echo "Installing func ${{env.VERSION}}"
program_url="https://github.com/knative/func/releases/download/knative-${{env.VERSION}}/func_linux_amd64"
curl -SLO $program_url && mv func_linux_amd64 f && chmod +x f
cp f /usr/local/bin
f version
- name: Build Functions
run: |
WORKDIR=$(mktemp -d)
cd $WORKDIR
echo "did the cd work?"
pwd
## NOTE: ls -d returns absolute path
## GITHUB_WORKSPACE is the root directory
#cycle through all languages
url="http://github.com/gauron99/func-templates"
for lang_dir_abs in $(ls -d ${GITHUB_WORKSPACE}/*/); do
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"
if [ $lang = "python" ];then
f create $lang-$template -r "$url"
else
f create $lang-$template -r "$url" -l "$lang" -t "$template"
fi
#FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f
done
done