Skip to content

fix(campaign): campagnes (#2405) #453

fix(campaign): campagnes (#2405)

fix(campaign): campagnes (#2405) #453

Workflow file for this run

name: "Analysis"
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Docker dependencies
working-directory: ./docker/lint
run: npm ci
- name: Run Docker Linter
working-directory: ./docker/lint
run: npm run start:local
- name: Install Public site dependencies
working-directory: public
run: npm ci
- name: 'Run Public site linter'
run: npm run lint
working-directory: public
code-audit:
name: Code audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 'Audit API dependencies'
run: npm audit --audit-level moderate && exit 0 || $([[ $? -ge 8 ]] && exit 1 || exit 0)
working-directory: api
- name: 'Audit dashboard dependencies'
run: npm audit --audit-level moderate && exit 0 || $([[ $? -ge 8 ]] && exit 1 || exit 0)
working-directory: dashboard
- name: 'Audit public site dependencies'
run: npm audit --audit-level moderate && exit 0 || $([[ $? -ge 8 ]] && exit 1 || exit 0)
working-directory: public
python-code-audit:
name: Python code audit
runs-on: ubuntu-latest
env:
DEP_PATH: notebooks/requirements.txt
steps:
- name: Check out master
uses: actions/checkout@master
- name: Security vulnerabilities scan
uses: aufdenpunkt/python-safety-check@master
with:
scan_requirements_file_only: 'true'
test:
needs: [lint, code-audit]
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: api/package-lock.json
- name: Install
run: npm ci
working-directory: api
- name: Build
run: npm run build
working-directory: api
- name: Run Unit test
run: npm run test:unit
working-directory: api
codeql:
needs: test
name: CodeQL
runs-on: ubuntu-latest
strategy:
matrix:
language: ['javascript']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
e2e:
needs: test
name: Test integration
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: api/package-lock.json
- name: Install
run: npm ci
working-directory: api
- name: Build
run: npm run build
working-directory: api
- name: Add host entries
run: |
sudo echo "127.0.0.1 api.covoiturage.test" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 s3.covoiturage.test" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 download.covoiturage.test" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 local-pdc-export.s3.covoiturage.test" | sudo tee -a /etc/hosts
- name: Enable ilos cli
run: |
rm -Rf ./proxy/node_modules/
npm ci
working-directory: api
- name: Run integration tests
env:
APP_POSTGRES_URL: postgres://postgres:postgres@localhost:5432/test
AWS_ACCESS_KEY_ID: minioadmin
APP_POSTGRES_TIMEOUT: 120000
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_ENDPOINT: http://localhost:9000
AWS_BUCKET_PREFIX: local-pdc
APP_REDIS_URL: redis://localhost:6379
INTEGRATION_MAILER_SMTP_HOST: localhost
APP_CEE_PUBLIC_KEY_PATH: ${{ github.workspace }}/docker/api/certs/publicKey.pem
APP_CEE_PRIVATE_KEY_PATH: ${{ github.workspace }}/docker/api/certs/privateKey.pem
APP_MAIL_SMTP_URL: smtp:localhost:1025
APP_DATAGOUV_URL: null
APP_DATAGOUV_KEY: null
APP_JWT_SECRET: null
APP_SESSION_SECRET: null
APP_ROUTECACHE_AUTHTOKEN: null
AWS_REGION: fr-par
run: ./integration.sh run