Compare commits

..

1 Commits

View File

@@ -12,7 +12,9 @@ branding:
runs:
using: composite
steps:
# Git Checkout
# ╭──────────────────────────────────────────────────────────╮
# │ Git Checkout │
# ╰──────────────────────────────────────────────────────────╯
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
@@ -22,11 +24,100 @@ runs:
# improve performance
fetch-depth: 0
# ╭──────────────────────────────────────────────────────────╮
# │ Setup Git configuration │
# ╰──────────────────────────────────────────────────────────╯
- name: Setup Git Config
id: git-config
uses: ivuorinen/actions/set-git-config@main
uses: ivuorinen/actions/set-git-config@d648dba57309a3437c6f7996fdacb478c5a99916 # 25.3.25
# MegaLinter
# ╭──────────────────────────────────────────────────────────╮
# │ Install packages for linting │
# ╰──────────────────────────────────────────────────────────╯
# Node.js tests if package.json exists
- name: Detect package.json
id: detect-node
shell: bash
run: |
if [ -f package.json ]; then
echo "found=true" >> $GITHUB_OUTPUT
fi
- name: Setup Node.js and run tests
if: steps.detect-node.outputs.found == 'true'
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
cache: 'npm'
- name: Install Node.js dependencies
if: steps.detect-node.outputs.found == 'true'
run: npm ci
# PHP tests if composer.json exists
- name: Detect composer.json
id: detect-php
shell: bash
run: |
if [ -f composer.json ]; then
echo "found=true" >> $GITHUB_OUTPUT
fi
- name: Setup PHP
if: steps.detect-php.outputs.found == 'true'
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # master
with:
tools: composer
coverage: none
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Setup problem matchers for PHP
if: steps.detect-php.outputs.found == 'true'
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Install PHP dependencies
if: steps.detect-php.outputs.found == 'true'
run: composer install --no-progress --prefer-dist --no-interaction
# Python tests if requirements.txt exists
- name: Detect requirements.txt
id: detect-python
shell: bash
run: |
if [ -f requirements.txt ]; then
echo "found=true" >> $GITHUB_OUTPUT
fi
- name: Setup Python
if: steps.detect-python.outputs.found == 'true'
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
cache: 'pip'
- name: Install Python dependencies
if: steps.detect-python.outputs.found == 'true'
run: pip install -r requirements.txt
# Go tests if go.mod exists
- name: Detect go.mod
id: detect-go
shell: bash
run: |
if [ -f go.mod ]; then
echo "found=true" >> $GITHUB_OUTPUT
fi
- name: Setup Go
if: steps.detect-go.outputs.found == 'true'
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: 'go.mod'
cache: true
# ╭──────────────────────────────────────────────────────────╮
# │ MegaLinter │
# ╰──────────────────────────────────────────────────────────╯
- name: MegaLinter
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.io/latest/flavors/