Skip to content

[IOPID-3164] Validation token creation migration #1946

[IOPID-3164] Validation token creation migration

[IOPID-3164] Validation token creation migration #1946

Workflow file for this run

# This workflow will perform the code review on each code change.
# It uses "actions/cache" and turborepo in order to perform tasks only on changed files.
name: "Continuous Integration"
on:
push:
branches:
- main
paths:
- apps/**
- packages/**
- package.json
- turbo.json
- .github/workflows/code_review.yaml
- docker/**/*
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- apps/**
- packages/**
- package.json
- turbo.json
- .github/workflows/code_review.yaml
- docker/**/*
workflow_dispatch:
jobs:
code_review:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version-file: ".node-version"
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Cache turbo build setup
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build
run: yarn build
- name: "Code review"
run: yarn code-review
# this step uses a set of filters to prevent
# additional work not needed
- uses: dorny/[email protected]
id: sonarcloud_filter
with:
filters: ./.github/ci_filters.yaml
- name: SonarCloud session-manager scan
if: steps.sonarcloud_filter.outputs.io-session-manager == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-session-manager/
- name: SonarCloud io-fast-login scan
if: steps.sonarcloud_filter.outputs.io-fast-login == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-fast-login/
- name: SonarCloud io-lollipop scan
if: steps.sonarcloud_filter.outputs.io-lollipop == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-lollipop/
- name: SonarCloud io-profile scan
if: steps.sonarcloud_filter.outputs.io-profile == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-profile/
- name: SonarCloud io-profile-async scan
if: steps.sonarcloud_filter.outputs.io-profile-async == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-profile-async/
- name: SonarCloud io-public scan
if: steps.sonarcloud_filter.outputs.io-public == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-public/
- name: SonarCloud io-session-manager-internal scan
if: steps.sonarcloud_filter.outputs.io-session-manager-internal == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-session-manager-internal/
- name: SonarCloud io-web-profile scan
if: steps.sonarcloud_filter.outputs.io-web-profile == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-web-profile/
- name: SonarCloud io-auth-n-identity-commons scan
if: steps.sonarcloud_filter.outputs.io-auth-n-identity-commons == 'true'
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: packages/io-auth-n-identity-commons/
e2e:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version-file: ".node-version"
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Cache turbo build setup
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build
run: yarn build
- name: Generate Environment
run: yarn docker:generate:env
- uses: dorny/[email protected]
id: test_filter
with:
filters: ./.github/ci_filters.yaml
- name: Free up some space before proceeding
if: >-
steps.test_filter.outputs.io-lollipop == 'true' ||
steps.test_filter.outputs.bruno-io-lollipop == 'true' ||
steps.test_filter.outputs.io-session-manager == 'true'
run: |
echo "::warning ::Disk usage before clean up:"
echo "::warning ::$(df -h)"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "::warning::Disk usage after clean up:"
echo "::warning::$(df -h)"
# TODO: in order to replicate the test with Bruno collections on the other services,
# it is necessary to integrate io-fixtures in the current project in order to
# setup and teardown the database.
- name: "io-lollipop integration Tests"
if: >-
steps.test_filter.outputs.io-lollipop == 'true' ||
steps.test_filter.outputs.bruno-io-lollipop == 'true'
run: >-
yarn docker:start:build traefik io-lollipop &&
yarn test:integrations:io-lollipop &&
yarn workspace io-auth-n-identity-bruno-collections \
bru run \
io-lollipop \
--env Development
- name: "E2E Tests"
if: steps.test_filter.outputs.io-session-manager == 'true'
run: yarn workspace e2e start