67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
# Pipeline à multiple scénarios
|
|
# pour l'environnement de dev
|
|
|
|
name: Dev Pipeline (frontend)
|
|
|
|
on:
|
|
# workflow_dispatch -> lancement manuel des jobs
|
|
workflow_dispatch:
|
|
inputs:
|
|
job_choice:
|
|
type: choice
|
|
description: "Choix du job"
|
|
options:
|
|
- build
|
|
- sonarqube
|
|
- test
|
|
- deploy
|
|
- all
|
|
|
|
# push:
|
|
# branches: [ "dev" ]
|
|
pull_request:
|
|
branches: [ "dev" ]
|
|
|
|
|
|
jobs:
|
|
build:
|
|
if: ${{ github.event.inputs.job_choice == 'build' }}
|
|
# The type of runner that the job will run on
|
|
runs-on: ubuntu-latest
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: actions/checkout@v4
|
|
# Runs a single command using the runners shell
|
|
- name: Run a one-line script
|
|
run: echo Hello, world!
|
|
# Runs a set of commands using the runners shell
|
|
# - name: Run a multi-line script
|
|
# run: |
|
|
# echo Add other actions to build,
|
|
# echo test, and deploy your project.
|
|
|
|
sonarqube:
|
|
name: SonarQube
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
- name: SonarQube Scan
|
|
uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 # v8.1.0
|
|
env:
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
test:
|
|
if: ${{ github.event.inputs.job_choice == 'test' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo "TEST job is running"
|
|
|
|
deploy:
|
|
if: ${{ github.event.inputs.job_choice == 'deploy' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo "DEPLOY job is running"
|