Skip to content

fix: upgrade FE for timeout to 30sec (#1139) #1375

fix: upgrade FE for timeout to 30sec (#1139)

fix: upgrade FE for timeout to 30sec (#1139) #1375

Workflow file for this run

name: Build, Test and Deploy
on:
push:
branches:
- main
- beta
pull_request:
env:
TZ: 'Europe/Paris'
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Cancel previous running workflows
uses: fkirc/skip-duplicate-actions@master
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18.20.1
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive --production=false
- name: Lint commit message
uses: wagoid/commitlint-github-action@v2
- name: lint Javascript
run: yarn lint
test:
name: Test
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.20.1
- name: Cache node_modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive --production=false
- name: Login on dockerhub
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Start docker container
run: docker compose up -d; sleep 20
- name: Run tests with coverage
run: yarn test:coverage
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: coverage/clover.xml # Assure-toi que c'est le bon chemin
send-coverage:
name: Send coverage
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [test] # Seulement test, pas test-cloud
if: github.event_name == 'pull_request'
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.20.1 # Ta version
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} # Ton pattern
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: reports
- name: Send coverage
uses: qltysh/qlty-action/coverage@8d5c844f32f80364ccc135534671640466e7f610 #v1.1
with:
oidc: true
files: ${{github.workspace}}/reports/**/clover.xml
deploy:
name: Release package
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # GITHUB_TOKEN must not be set for the semantic release
- uses: actions/setup-node@v4
with:
node-version: 18.20.1
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Build package
run: yarn build
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
semantic_version: 17.3.0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}