Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Update main.yml

Update main.yml #5

Workflow file for this run

name: Fn Project Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Docker
uses: docker-practice/actions-setup-docker@master
- name: Install Fn Project CLI
run: |
curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh
- name: Install jq
run: sudo apt-get install -y jq
- name: Start Fn Server
run: fn start &
- name: Create Fn App
run: fn create app goapp
- name: Deploy Fn App
run: fn --verbose deploy --app goapp --local
- name: Test Fn Function
id: test-function
run: |
response=$(echo -n '{"avatarJSON":"","size":512}' | fn invoke goapp render --content-type application/json)
echo "::set-output name=response::$response"
- name: Save Image
run: |
image_data=$(echo "${{ steps.test-function.outputs.response }}" | jq -r '.image')
echo "$image_data" | base64 -d > output.png
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: rendered-image
path: output.png
- name: Stop Fn Server
run: fn stop
if: always()