Skip to content

Increase job name max length from 12 to 30 characters #612

Increase job name max length from 12 to 30 characters

Increase job name max length from 12 to 30 characters #612

Workflow file for this run

name: SlimFaas main CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]
env:
PNPM_VERSION: 10.14.0
NODE_VERSION: "24"
permissions:
id-token: write
contents: write
jobs:
sonarcloud:
name: SonarCloud
runs-on: windows-latest
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v4
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: pnpm ci
run: pnpm i --frozen-lockfile
working-directory: ./src/SlimFaasPlanetSaver
- name: pnpm run coverage
run: |
pnpm run coverage
Remove-Item -Path .\coverage\lcov-report -Recurse -Force
working-directory: ./src/SlimFaasPlanetSaver
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"SlimPlanet_SlimFaas" /o:"slimplanet" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.coverage.exclusions="src/Fibonacci/**/*,src/FibonacciReact/**/*,demo/**/*,src/SlimFaasPlanetSaver/coverage/**/*,src/SlimFaasSite/**/*" /d:sonar.javascript.lcov.reportPaths="src/SlimFaasPlanetSaver/coverage/lcov.info" /d:sonar.javascript.file.suffixes="js,jsx"
dotnet tool install --global dotnet-coverage
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Run unit tests
run: |
dotnet test --collect "Code Coverage;Format=cobertura" --verbosity normal
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.4.4
with:
reports: './**/TestResults/**/*.cobertura.xml'
targetdir: 'coveragereport'
reporttypes: 'MarkdownSummaryGithub'
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: pnpm ci
run: pnpm i --frozen-lockfile
working-directory: ./src/SlimFaasPlanetSaver
- name: pnpm run coverage
run: pnpm run coverage
working-directory: ./src/SlimFaasPlanetSaver
- name: Publish coverage in build summary
run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
shell: bash
tags:
needs: [unit_tests]
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
outputs:
new_version: ${{ steps.tag.outputs.new_version }}
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine Alpha, Beta or Release
id: which_tag
run: |
if [[ ${{ github.ref }} == refs/pull* ]]; then
last_commit_message=$(curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.number }}/commits" | jq -r '.[-1].commit.message')
else
last_commit_message=$(git log --format=%B -n 1)
fi
echo "last commit message is: $last_commit_message"
echo "tag=default" >> $GITHUB_OUTPUT
if [[ $last_commit_message == *alpha* ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
fi
if [[ $last_commit_message == *beta* ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
fi
if [[ $last_commit_message == *release* && ${{ github.ref }} == 'refs/heads/main' ]]; then
echo "tag=release" >> $GITHUB_OUTPUT
fi
- name: Bump version and push tag
id: tag_release
if: steps.which_tag.outputs.tag == 'release'
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GIT_TOKEN }}
- name: Bump version and push tag
id: tag_version
if: steps.which_tag.outputs.tag != 'release'
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GIT_TOKEN }}
dry_run: true
- name: Compute new version number to publish
id: tag
run: |
if [[ '${{ steps.which_tag.outputs.tag }}' == 'release' ]]; then
version=${{ steps.tag_release.outputs.new_version }}
else
version=${{ steps.tag_version.outputs.new_version }}
fi
if [[ '${{ steps.which_tag.outputs.tag }}' = 'release' ]]; then
echo "new_version=$version" >> $GITHUB_OUTPUT
fi
if [[ '${{ steps.which_tag.outputs.tag }}' = 'alpha' ]]; then
echo "new_version=$version-alpha.${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
if [[ '${{ steps.which_tag.outputs.tag }}' = 'beta' ]]; then
echo "new_version=$version-beta.${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
if [[ '${{ steps.which_tag.outputs.tag }}' = 'default' ]]; then
if [ '${{ github.ref }}' = 'refs/heads/main' ]; then
echo "new_version=$version-dev.${{ github.run_number }}" >> $GITHUB_OUTPUT
else
echo "new_version=$version-pr.${{ github.event.number }}${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
fi
tag=${{ steps.which_tag.outputs.tag }}
echo "tag=$tag" >> $GITHUB_OUTPUT
build_slimfaas:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/slimfaas"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "."
image_file: "./Dockerfile"
platforms: "linux/amd64,linux/arm64"
readme_url: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/README.md
image_description: "SlimFaas: fast FaaS + jobs/cron, scalable amd simple."
license: "Apache-2.0"
keywords: "slimfaas,faas,proxy,serverless,queue,publish/subscribe,jobs,cron,kubernetes"
logo_url: https://raw.githubusercontent.com/${{ github.repository }}/main/documentation/SlimFaas.png
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_slimfaas_kafka:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/slimfaas-kafka"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "./src/SlimFaasKafka"
image_file: "./src/SlimFaasKafka/Dockerfile"
platforms: "linux/amd64,linux/arm64"
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_fibonacci_kafka_producer:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/fibonacci-kafka-producer"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "./src/FibonacciKafkaProducer"
image_file: "./src/FibonacciKafkaProducer/Dockerfile"
platforms: "linux/amd64,linux/arm64"
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_fibonacci_kafka_listener:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/fibonacci-kafka-listener"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "./src/FibonacciKafkaListener"
image_file: "./src/FibonacciKafkaListener/Dockerfile"
platforms: "linux/amd64,linux/arm64"
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_fibonacci_api:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/fibonacci-api"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "./src/Fibonacci"
image_file: "./src/Fibonacci/Dockerfile"
platforms: "linux/amd64,linux/arm64"
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_fibonacci_mcp:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/slimfaas-mcp"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "./src/SlimFaasMcp"
image_file: "./src/SlimFaasMcp/Dockerfile"
platforms: "linux/amd64,linux/arm64"
readme_url: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/README.md
image_description: "SlimFaas MCP: proxy OpenAPI -> MCP (tools) with OAuth, upload, etc."
license: "Apache-2.0"
keywords: "mcp,slimfaas,openapi,proxy,oauth,oidc,tools"
logo_url: https://raw.githubusercontent.com/${{ github.repository }}/main/documentation/SlimFaas.png
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_fibonacci_batch:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/fibonacci-batch"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "."
image_file: "./src/FibonacciBatch/Dockerfile"
platforms: "linux/amd64,linux/arm64"
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_fibonacci_webapp:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
uses: ./.github/workflows/Docker.yml
with:
image_name: "axaguildev/fibonacci-webapp"
image_version: "${{ needs.tags.outputs.new_version }}"
image_build_args: ""
image_context: "./src/FibonacciReact"
image_file: "./src/FibonacciReact/Dockerfile"
platforms: "linux/amd64,linux/arm64"
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build_slimfaas_mcp_aot:
needs: tags
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
strategy:
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
zip: SlimFaasMcp-linux-x64.zip
- os: windows-latest
rid: win-x64
zip: SlimFaasMcp-win-x64.zip
- os: macos-latest
rid: osx-x64
zip: SlimFaasMcp-osx-x64.zip
- os: macos-14
rid: osx-arm64
zip: SlimFaasMcp-osx-arm64.zip
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Publish SlimFaasMcp (${{ matrix.rid }})
run: |
dotnet publish ./src/SlimFaasMcp/SlimFaasMcp.csproj \
-c Release -r ${{ matrix.rid }} \
-o ./publish \
-p:PublishAot=true \
-p:PublishTrimmed=true \
-p:SelfContained=true \
-p:InvariantGlobalization=true \
-p:DebugType=none \
-p:DebugSymbols=false
shell: bash
- name: Zip artifact (Linux & macOS)
if: runner.os != 'Windows'
run: |
cd publish
zip -r ../${{ matrix.zip }} .
shell: bash
- name: Zip artifact (Windows)
if: runner.os == 'Windows'
run: |
Compress-Archive -Path publish\* -DestinationPath ${{ matrix.zip }}
shell: powershell
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.zip }}
path: ${{ matrix.zip }}
if-no-files-found: error
publish_slimfaas_mcp_release:
needs: [tags, build_slimfaas_mcp_aot]
if: needs.tags.outputs.tag == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
pattern: SlimFaasMcp-*.zip
merge-multiple: true
- name: Create GitHub Release & upload assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.tags.outputs.new_version }}
name: "SlimFaas MCP ${{ needs.tags.outputs.new_version }}"
body: |
**SlimFaasMcp** build native AOT for 4 platforms :
* linux-x64
* windows-x64
* macOS (x64)
* macOS (arm64)
draft: false
prerelease: false
files: |
SlimFaasMcp-*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_slimfaas_planet_saver:
needs: tags
if: github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: pnpm ci
run: pnpm i --frozen-lockfile
working-directory: ./src/SlimFaasPlanetSaver
- name: Git Configuration
id: gitconfig
run: |
git config --global user.email "github-action@bot.com"
git config --global user.name "GitHub"
- name: pnpm version ${{ needs.tags.outputs.new_version }}
run: |
pnpm version ${{ needs.tags.outputs.new_version }}
working-directory: ./src/SlimFaasPlanetSaver
- id: Publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./src/SlimFaasPlanetSaver/package.json
deploy_website:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: ./src/SlimFaasSite
- name: Build site
run: pnpm build
working-directory: ./src/SlimFaasSite
- name: Add CNAME file
run: echo 'slimfaas.dev' > out/CNAME
working-directory: ./src/SlimFaasSite
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./src/SlimFaasSite/out
cname: slimfaas.dev
change_log:
runs-on: ubuntu-latest
if: needs.tags.outputs.tag == 'release'
needs: [ tags ]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GIT_TOKEN }}
fetch-depth: 0
- name: Commit and push
run: |
git config --global user.name "GitHub"
git config --global user.email "github-action@bot.com"
chmod +x ./.bin/generate-changelog.sh
./.bin/generate-changelog.sh
git add .
git commit -s -m "[skip ci] Generate changelog to version ${{ needs.tags.outputs.new_version }}"
git tag ${{ needs.tags.outputs.new_version }}
git push --set-upstream origin "HEAD:main" --follow-tags -f