Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions .github/workflows/build-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,30 @@ on:
default: 'latest'
artifact-name:
type: string
description: 'Give generated artifact a name'
description: 'Name of the artifact to upload, default: is basename of the artifact if single file, or dirname if multiple files, followed by the OS name'
required: false
artifact-path:
type: string
description: 'Path to the generated artifact to upload'
required: false
default: 'dist/'
outputs:
artifact-id:
description: 'The ID of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-id }}
artifact-url:
description: 'The URL of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-url }}

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}

outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4

Expand All @@ -49,11 +58,36 @@ jobs:
- name: Install Bun dependencies
run: bun install

- name: Build with Bun
run: bun run build
- id: build
name: Build with Bun
run: |
bun run build
if [ -n "${{ inputs.artifact-path }}" ]; then
echo -e "Artifact path is set to '${{ inputs.artifact-path }}.\nIncluding :"
ARTIFACT_CONTENT="$(ls -dAp "${{ inputs.artifact-path }}")"
echo "$ARTIFACT_CONTENT"
if [ -z "${{ inputs.artifact-name }}" ]; then
artifact_path="${{ inputs.artifact-path }}"
if [ -d "$artifact_path" ]; then
echo "Artifact path is a directory, using it as is."
artifact_path="$(dirname "$artifact_path")"
elif [ -f "$artifact_path" ]; then
echo "Artifact path is a file, using it as is."
artifact_path="$artifact_path"
elif [ "$(ls -A "$artifact_path")" ]; then
echo "Artifact is multiple files, using the directory."
artifact_path="$(dirname "$artifact_path")"
fi
ARTIFACT_NAME="${artifact_path}-${{ runner.os }}"
else
ARTIFACT_NAME="${{ inputs.artifact-name }}"
fi
echo "artifact-name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
fi

- name: Upload build artifacts
if: inputs.artifact-name != '' && inputs.artifact-path != ''
if: steps.build.outputs.artifact-name != '' && inputs.artifact-path != ''
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,27 @@ on:
default: 'Dockerfile'
with-artifact-name:
type: string
description: 'Name of the artifact to include in the image'
description: 'Name of the artifact to include in the image, can''t be used with with-artifact-ids'
required: false
with-artifact-ids:
type: string
description: 'Comma separated list of Ids of the artifact to include in the image, can''t be used with with-artifact-name'
required: false
with-artifact-unzip:
type: string
description: 'Comma separated list of ids or name of downloaded artifact that will be unzip. Default to all artifacts'
required: false
default: '*'
with-artifact-path:
type: string
description: 'Where to place the artifacts'
required: false
default: 'artifacts/'
with-artifact-merge:
type: boolean
description: 'Whether to merge multiple artifacts into one folder'
required: false
default: false

permissions:
contents: read
Expand All @@ -43,12 +57,14 @@ jobs:
- uses: actions/checkout@v4

- name: Download artifact
if: inputs.with-artifact-name != ''
uses: actions/download-artifact@v4
if: inputs.with-artifact-name != '' || inputs.with-artifact-ids != ''
uses: shiipou/download-artifact@main
with:
name: ${{ inputs.with-artifact-name }}
artifact-ids: ${{ inputs.with-artifact-ids }}
path: ${{ inputs.working-directory }}/${{ inputs.with-artifact-path }}

unzip: ${{ inputs.with-artifact-unzip }}
merge-multiple: ${{ inputs.with-artifact-merge }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/build-flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,23 @@ on:
UPLOAD_STORE_PASSWORD:
description: 'Password for the Android keystore'
required: false
outputs:
artifact-id:
description: 'The ID of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-id }}
artifact-url:
description: 'The URL of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-url }}

jobs:
build:
defaults:
run:
working-directory: ${{ inputs.working-directory }}
runs-on: ${{ inputs.runner }}
outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/build-springboot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,24 @@ on:
envs:
description: 'Add extra env variable to the build, one value per line : <name>=<value>'
required: false

outputs:
artifact-id:
description: 'The ID of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-id }}
artifact-url:
description: 'The URL of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-url }}
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}

outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4


- run: echo "${{ inputs.envs }}" >> .env
- run: echo "${{ secrets.envs }}" >> .env
Expand All @@ -61,7 +68,8 @@ jobs:
- name: Build with Gradle
run: gradle build -x test

- name: Upload build artifacts
- id: upload-artifact
name: Upload build artifacts
if: inputs.artifact-name != '' && inputs.artifact-path != ''
uses: actions/upload-artifact@v4
with:
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ on:
inputs:
with-artifact-name:
type: string
description: Coverage report artifact name
required: true
description: Coverage report artifact name, can't be used with with-artifact-ids
required: false
with-artifact-ids:
type: string
description: Coverage report artifact ids, can't be used with with-artifact-name
required: false
with-artifact-path:
type: string
description: Path to the coverage report artifact
required: false
default: lcov.info
with-artifact-merge:
type: boolean
description: Whether to merge multiple artifacts into one folder
required: false
default: false
min-lines-coverage:
type: number
description: Minimum percentage of lines covered
Expand Down Expand Up @@ -63,10 +72,12 @@ jobs:
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Download coverage report
uses: actions/download-artifact@v4
uses: shiipou/download-artifact@main
with:
name: ${{ inputs.artifact-name }}
name: ${{ inputs.with-artifact-name }}
artifact-ids: ${{ inputs.with-artifact-ids }}
path: coverage/
merge-multiple: ${{ inputs.with-artifact-merge }}
- name: Parse coverage report
id: coverage
run: |
Expand All @@ -77,7 +88,7 @@ jobs:
echo "${BASH_REMATCH[1]}-total=${BASH_REMATCH[4]}" >> $GITHUB_OUTPUT
echo "${BASH_REMATCH[1]}-percentage=${BASH_REMATCH[2]}" >> $GITHUB_OUTPUT
fi
done < <(lcov --summary coverage/${{ inputs.artifact-path }})
done < <(lcov --summary coverage/${{ inputs.with-artifact-path }})
- name: Check coverage report data
if: inputs.min-lines-coverage != ''
run: |
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/deploy-flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,26 @@ on:
required: true
with-artifact-name:
type: string
description: 'Identifier for the build artifact (e.g., android-aab or ios-ipa)'
required: true
description: 'Name for the build artifact to download (e.g., android-aab or ios-ipa), can''t be used with with-artifact-ids'
required: false
with-artifact-ids:
type: string
description: 'Comma separated list of ids of the builds artifact to download, can''t be used with with-artifact-name'
required: false
with-artifact-unzip:
type: string
description: 'Comma separated list of ids or name of downloaded artifact that will be unzip. Default to all artifacts'
required: false
default: '*'
with-artifact-path:
type: string
description: 'Path to the build file to deploy (inside of the artifact)'
required: true
with-artifact-merge:
type: boolean
description: 'Whenever to download multiple artifacts into one same folder'
required: false
default: false
package-name:
type: string
description: 'The package name of the app'
Expand Down Expand Up @@ -46,10 +60,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/download-artifact@v4
uses: shiipou/download-artifact@main
with:
name: ${{ inputs.with-artifact-name }}
artifact-ids: ${{ inputs.with-artifact-ids }}
unzip: ${{ inputs.with-artifact-unzip }}
path: ./artifacts/
merge-multiple: ${{ inputs.with-artifact-merge }}
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2.18.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-version-names.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
tags="$tags,${template//\[:version:\]/$major_minor},${template//\[:version:\]/$major}"
else
# For prerelease, generate only the major.minor-prerelease tag
major_minor_prerelease=$(echo "$version" | grep -oE '^[0-9]+\.[0-9]+-[^\.]+')
if [[ -n "$major_minor_prerelease" ]]; then
major_minor_prerelease=$(echo "$version" | sed -E 's/^([0-9]+)\.([0-9]+).([0-9]+)-(.+)$/\1.\2-\4/')
if [[ "$major_minor_prerelease" != "$version" ]]; then
tags="$tags,${template//\[:version:\]/$major_minor_prerelease}"
fi
fi
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,23 @@ on:
description: 'Version of Java to use'
required: false
default: 'latest'
outputs:
artifact-id:
description: 'The ID of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-id }}
artifact-url:
description: 'The URL of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact-url }}

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}

outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4

Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@ on:
description: 'Coverage report path to upload as artifact'
required: false
default: 'coverage/lcov.info'
outputs:
artifact-id:
description: 'The ID of the uploaded artifact'
value: ${{ jobs.test.outputs.artifact-id }}
artifact-url:
description: 'The URL of the uploaded artifact'
value: ${{ jobs.test.outputs.artifact-url }}

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/test-springboot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,24 @@ on:
type: string
description: 'The profile of the composefile to load'
required: false


outputs:
artifact-id:
description: 'The ID of the uploaded artifact'
value: ${{ jobs.test.outputs.artifact-id }}
artifact-url:
description: 'The URL of the uploaded artifact'
value: ${{ jobs.test.outputs.artifact-url }}

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}

steps:
- uses: actions/checkout@v4
Expand All @@ -53,15 +64,13 @@ jobs:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}
cache: gradle

- name: Run compose-file
if: inputs.compose-file != ''
run: |
docker compose up -f ${{ inputs.compose-file }} --profile ${{ $inputs.compose-profile }} -d
docker compose -f ${{ inputs.compose-file }} --profile ${{ inputs.compose-profile }} up -d

- name: Build with Gradle
env:
DATABASE_URL: postgresql://localhost:5432/app
DATABASE_USER: app
DATABASE_PASSWORD: app
run: gradle test

- name: Upload build artifacts
Expand All @@ -70,6 +79,7 @@ jobs:
with:
name: ${{ inputs.artifact-name }}
path: ${{ inputs.working-directory }}/${{ inputs.artifact-path }}

- name: Stop compose-file
if: inputs.compose-file != '' && always()
run: docker compose down -f ${{ inputs.compose-file }} --profile ${{ $inputs.compose-profile }}
run: docker compose -f ${{ inputs.compose-file }} --profile ${{ inputs.compose-profile }} down
Loading
Loading