chore(META): use open source lint reporter #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Movies Project Master | ||
on: | ||
push: | ||
branches: | ||
- master | ||
concurrency: ${{ github.ref_name }} | ||
env: | ||
ARTIFACTORY_CONTEXT: https://artifactory.mpi-internal.com/artifactory | ||
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} | ||
ARTIFACTORY_PWD: ${{ secrets.ARTIFACTORY_PWD }} | ||
ARTIFACTORY_NPM_SECRET: ${{ secrets.ARTIFACTORY_NPM_SECRET }} | ||
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} | ||
GITHUB_EMAIL: 'srv.scms.git-enb@adevinta.com' | ||
GITHUB_USER: 'srv-scms-git-enb' | ||
GITHUB_TOKEN: ${{ github.token }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
APPLICATION_NAME: "pet-movies" | ||
CDN_PRE: "https://scm-milanuncios-frontend-pre.milanuncios.net/pet-movies/development/" | ||
CDN_PRO: "https://scm-milanuncios-frontend-pre.milanuncios.net/pet-movies/production/" | ||
AWS_ACCOUNT_ID_PRE: '060140816915' | ||
AWS_ACCOUNT_ID_PRO: '060140816915' | ||
S3_BUCKET_APPLICATION_PRE: "s3://scm-milanuncios-frontend-pre/pet-movies/development" | ||
S3_BUCKET_APPLICATION_PRO: "s3://scm-milanuncios-frontend-pre/pet-movies/production" | ||
WIDGETS_CDN_PRE: "https://scm-milanuncios-frontend-pre.milanuncios.net/pet-movies/widgets/development/" | ||
WIDGETS_CDN_PRO: "https://scm-milanuncios-frontend-pre.milanuncios.net/pet-movies/widgets/production/" | ||
WIDGETS_AWS_ACCOUNT_ID_PRE: '060140816915' | ||
WIDGETS_AWS_ACCOUNT_ID_PRO: '060140816915' | ||
WIDGETS_S3_BUCKET_APPLICATION_PRE: "s3://scm-milanuncios-frontend-pre/pet-movies/widgets/development" | ||
WIDGETS_S3_BUCKET_APPLICATION_PRO: "s3://scm-milanuncios-frontend-pre/pet-movies/widgets/production" | ||
RESOURCES_CDN_PRE: "https://scm-milanuncios-frontend-pre.milanuncios.net/pet-movies/resources/development/" | ||
RESOURCES_CDN_PRO: "https://scm-milanuncios-frontend-pre.milanuncios.net/pet-movies/resources/production/" | ||
RESOURCES_AWS_ACCOUNT_ID_PRE: '060140816915' | ||
RESOURCES_AWS_ACCOUNT_ID_PRO: '060140816915' | ||
RESOURCES_S3_BUCKET_APPLICATION_PRE: "s3://scm-milanuncios-frontend-pre/pet-movies/resources/development" | ||
RESOURCES_S3_BUCKET_APPLICATION_PRO: "s3://scm-milanuncios-frontend-pre/pet-movies/resources/production" | ||
BOUNDED_CONTEXT: "es-microtest" | ||
jobs: | ||
compute: | ||
name: 🖥️ Compute | ||
runs-on: small | ||
outputs: | ||
APPLICATION_NAME: ${{ env.APPLICATION_NAME }} | ||
CDN_PRE: ${{ env.CDN_PRE }} | ||
CDN_PRO: ${{ env.CDN_PRO }} | ||
AWS_ACCOUNT_ID_PRE: ${{ env.AWS_ACCOUNT_ID_PRE }} | ||
AWS_ACCOUNT_ID_PRO: ${{ env.AWS_ACCOUNT_ID_PRO }} | ||
S3_BUCKET_APPLICATION_PRE: ${{ env.S3_BUCKET_APPLICATION_PRE }} | ||
S3_BUCKET_APPLICATION_PRO: ${{ env.S3_BUCKET_APPLICATION_PRO }} | ||
WIDGETS_CDN_PRE: ${{ env.WIDGETS_CDN_PRE }} | ||
WIDGETS_CDN_PRO: ${{ env.WIDGETS_CDN_PRO }} | ||
WIDGETS_AWS_ACCOUNT_ID_PRE: ${{ env.WIDGETS_AWS_ACCOUNT_ID_PRE }} | ||
WIDGETS_AWS_ACCOUNT_ID_PRO: ${{ env.WIDGETS_AWS_ACCOUNT_ID_PRO }} | ||
WIDGETS_S3_BUCKET_APPLICATION_PRE: ${{ env.WIDGETS_S3_BUCKET_APPLICATION_PRE }} | ||
WIDGETS_S3_BUCKET_APPLICATION_PRO: ${{ env.WIDGETS_S3_BUCKET_APPLICATION_PRO }} | ||
RESOURCES_CDN_PRE: ${{ env.RESOURCES_CDN_PRE }} | ||
RESOURCES_CDN_PRO: ${{ env.RESOURCES_CDN_PRO }} | ||
RESOURCES_AWS_ACCOUNT_ID_PRE: ${{ env.RESOURCES_AWS_ACCOUNT_ID_PRE }} | ||
RESOURCES_AWS_ACCOUNT_ID_PRO: ${{ env.RESOURCES_AWS_ACCOUNT_ID_PRO }} | ||
RESOURCES_S3_BUCKET_APPLICATION_PRE: ${{ env.RESOURCES_S3_BUCKET_APPLICATION_PRE }} | ||
RESOURCES_S3_BUCKET_APPLICATION_PRO: ${{ env.RESOURCES_S3_BUCKET_APPLICATION_PRO }} | ||
BOUNDED_CONTEXT: ${{ env.BOUNDED_CONTEXT }} | ||
steps: | ||
- name: Compute outputs | ||
run: | | ||
echo "APPLICATION_NAME=${{ env.APPLICATION_NAME }}" >> $GITHUB_OUTPUT | ||
echo "CDN_PRE=${{ env.CDN_PRE }}" >> $GITHUB_OUTPUT | ||
echo "CDN_PRO=${{ env.CDN_PRO }}" >> $GITHUB_OUTPUT | ||
echo "AWS_ACCOUNT_ID_PRE=${{ env.AWS_ACCOUNT_ID_PRE }}" >> $GITHUB_OUTPUT | ||
echo "AWS_ACCOUNT_ID_PRO=${{ env.AWS_ACCOUNT_ID_PRO }}" >> $GITHUB_OUTPUT | ||
echo "S3_BUCKET_APPLICATION_PRE=${{ env.S3_BUCKET_APPLICATION_PRE }}" >> $GITHUB_OUTPUT | ||
echo "S3_BUCKET_APPLICATION_PRO=${{ env.S3_BUCKET_APPLICATION_PRO }}" >> $GITHUB_OUTPUT | ||
echo "WIDGETS_CDN_PRE=${{ env.WIDGETS_CDN_PRE }}" >> $GITHUB_OUTPUT | ||
echo "WIDGETS_CDN_PRO=${{ env.WIDGETS_CDN_PRO }}" >> $GITHUB_OUTPUT | ||
echo "WIDGETS_AWS_ACCOUNT_ID_PRE=${{ env.WIDGETS_AWS_ACCOUNT_ID_PRE }}" >> $GITHUB_OUTPUT | ||
echo "WIDGETS_AWS_ACCOUNT_ID_PRO=${{ env.WIDGETS_AWS_ACCOUNT_ID_PRO }}" >> $GITHUB_OUTPUT | ||
echo "WIDGETS_S3_BUCKET_APPLICATION_PRE=${{ env.WIDGETS_S3_BUCKET_APPLICATION_PRE }}" >> $GITHUB_OUTPUT | ||
echo "WIDGETS_S3_BUCKET_APPLICATION_PRO=${{ env.WIDGETS_S3_BUCKET_APPLICATION_PRO }}" >> $GITHUB_OUTPUT | ||
echo "RESOURCES_CDN_PRE=${{ env.RESOURCES_CDN_PRE }}" >> $GITHUB_OUTPUT | ||
echo "RESOURCES_CDN_PRO=${{ env.RESOURCES_CDN_PRO }}" >> $GITHUB_OUTPUT | ||
echo "RESOURCES_AWS_ACCOUNT_ID_PRE=${{ env.RESOURCES_AWS_ACCOUNT_ID_PRE }}" >> $GITHUB_OUTPUT | ||
echo "RESOURCES_AWS_ACCOUNT_ID_PRO=${{ env.RESOURCES_AWS_ACCOUNT_ID_PRO }}" >> $GITHUB_OUTPUT | ||
echo "RESOURCES_S3_BUCKET_APPLICATION_PRE=${{ env.RESOURCES_S3_BUCKET_APPLICATION_PRE }}" >> $GITHUB_OUTPUT | ||
echo "RESOURCES_S3_BUCKET_APPLICATION_PRO=${{ env.RESOURCES_S3_BUCKET_APPLICATION_PRO }}" >> $GITHUB_OUTPUT | ||
echo "BOUNDED_CONTEXT=${{ env.BOUNDED_CONTEXT }}" >> $GITHUB_OUTPUT | ||
build-app: | ||
name: 🔨 Build App | ||
runs-on: big | ||
needs: compute | ||
strategy: | ||
matrix: | ||
include: | ||
- stage: development | ||
CDN: ${{ needs.compute.outputs.CDN_PRE }} | ||
WIDGETS_CDN: ${{ needs.compute.outputs.WIDGETS_CDN_PRE }} | ||
- stage: production | ||
CDN: ${{ needs.compute.outputs.CDN_PRO }} | ||
WIDGETS_CDN: ${{ needs.compute.outputs.WIDGETS_CDN_PRO }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/build-app | ||
with: | ||
stage: ${{ matrix.stage }} | ||
cdn: ${{ matrix.CDN }} | ||
widgets-cdn: ${{ matrix.WIDGETS_CDN }} | ||
resources: | ||
name: 📡 Upload resources | ||
runs-on: medium | ||
needs: | ||
- compute | ||
- build-app | ||
permissions: | ||
id-token: write | ||
contents: read | ||
strategy: | ||
matrix: | ||
include: | ||
- stage: 'development' | ||
aws-account-id: '${{ needs.compute.outputs.RESOURCES_AWS_ACCOUNT_ID_PRE }}' | ||
s3-bucket: ${{ needs.compute.outputs.RESOURCES_S3_BUCKET_APPLICATION_PRE }} | ||
- stage: 'production' | ||
aws-account-id: '${{ needs.compute.outputs.RESOURCES_AWS_ACCOUNT_ID_PRO }}' | ||
s3-bucket: ${{ needs.compute.outputs.RESOURCES_S3_BUCKET_APPLICATION_PRO }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/resources | ||
with: | ||
s3-bucket: ${{ matrix.s3-bucket }} | ||
aws-account-id: '${{ matrix.aws-account-id }}' | ||
aws-region: 'eu-west-3' | ||
stage: ${{ matrix.stage }} | ||
release: | ||
runs-on: big | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install | ||
uses: scmspain/platform-common--actions/frontend/install@v0 | ||
- name: Publish packages | ||
run: npx @s-ui/mono@beta release --github-user $GITHUB_USER --github-email $GITHUB_EMAIL --github-token $GITHUB_TOKEN --lock | ||
lint: | ||
name: 🤖 Lint | ||
runs-on: medium | ||
needs: compute | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/composite/lint | ||
with: | ||
lint-js-flags: "--force-full-lint --reporter node_modules/@s-ui/lint-reporters/umd/sui-lint-js-reporter.bundle.js" | ||
lint-repository-flags: "--reporter node_modules/@s-ui/lint-reporters/umd/sui-lint-repository-reporter.bundle.js" | ||
test-domain: | ||
name: 🧪 Testing | ||
runs-on: big | ||
needs: compute | ||
strategy: | ||
matrix: | ||
stage: ['development', 'production'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/test-domain | ||
with: | ||
stage: ${{ matrix.stage }} | ||
dockerize: | ||
name: 📦 Dockerize | ||
runs-on: medium | ||
needs: | ||
- compute | ||
- build-app | ||
strategy: | ||
matrix: | ||
include: | ||
- stage: development | ||
CDN: ${{ needs.compute.outputs.CDN_PRE }} | ||
- stage: production | ||
CDN: ${{ needs.compute.outputs.CDN_PRO }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/dockerize | ||
with: | ||
stage: ${{ matrix.stage }} | ||
suffix: '${{ needs.compute.outputs.APPLICATION_NAME }}-${{ matrix.stage }}' | ||
cdn: ${{ matrix.CDN }} | ||
widgets: | ||
name: 📡 Upload Widgets | ||
runs-on: medium | ||
needs: | ||
- compute | ||
- build-app | ||
permissions: | ||
id-token: write | ||
contents: read | ||
strategy: | ||
matrix: | ||
include: | ||
- stage: 'development' | ||
aws-account-id: '${{ needs.compute.outputs.WIDGETS_AWS_ACCOUNT_ID_PRE }}' | ||
s3-bucket: ${{ needs.compute.outputs.WIDGETS_S3_BUCKET_APPLICATION_PRE }} | ||
- stage: 'production' | ||
aws-account-id: '${{ needs.compute.outputs.WIDGETS_AWS_ACCOUNT_ID_PRO }}' | ||
s3-bucket: ${{ needs.compute.outputs.WIDGETS_S3_BUCKET_APPLICATION_PRO }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/widgets | ||
with: | ||
s3-bucket: ${{ matrix.s3-bucket }} | ||
aws-account-id: '${{ matrix.aws-account-id }}' | ||
aws-region: 'eu-west-3' | ||
stage: ${{ matrix.stage }} | ||
cdn: | ||
name: 📡 Upload CDN | ||
runs-on: medium | ||
needs: | ||
- compute | ||
- build-app | ||
permissions: | ||
id-token: write | ||
contents: read | ||
strategy: | ||
matrix: | ||
include: | ||
- stage: 'development' | ||
aws-account-id: '${{ needs.compute.outputs.AWS_ACCOUNT_ID_PRE }}' | ||
s3-bucket: ${{ needs.compute.outputs.S3_BUCKET_APPLICATION_PRE }} | ||
- stage: 'production' | ||
aws-account-id: '${{ needs.compute.outputs.AWS_ACCOUNT_ID_PRO }}' | ||
s3-bucket: ${{ needs.compute.outputs.S3_BUCKET_APPLICATION_PRO }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/cdn | ||
with: | ||
s3-bucket: ${{ matrix.s3-bucket }} | ||
aws-account-id: '${{ matrix.aws-account-id }}' | ||
aws-region: 'eu-west-3' | ||
stage: ${{ matrix.stage }} | ||
test-ui: | ||
name: 🧪 Tests UI | ||
runs-on: big | ||
needs: | ||
- compute | ||
- build-app | ||
strategy: | ||
matrix: | ||
pattern: ['layout/header/test', 'layout/footer/test'] | ||
stage: ['development', 'production'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/test-ui | ||
with: | ||
pattern: ${{ matrix.pattern }} | ||
stage: ${{ matrix.stage }} | ||
e2e: | ||
name: 🎭 Tests E2E | ||
runs-on: big | ||
needs: | ||
- compute | ||
- dockerize | ||
- cdn | ||
strategy: | ||
matrix: | ||
scope: ['integration/home', 'integration/detail'] | ||
stage: ['development', 'production'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/e2e | ||
with: | ||
scope: ${{ matrix.scope }} | ||
application-image: 'containers.mpi-internal.com/${{ github.repository }}-${{ needs.compute.outputs.APPLICATION_NAME }}-${{ matrix.stage }}:${{ github.sha }}' | ||
critical-css: | ||
name: 🔮 Critical CSS | ||
runs-on: big | ||
needs: | ||
- compute | ||
- dockerize | ||
- cdn | ||
strategy: | ||
matrix: | ||
include: | ||
- stage: development | ||
CDN: ${{ needs.compute.outputs.CDN_PRE }} | ||
- stage: production | ||
CDN: ${{ needs.compute.outputs.CDN_PRO }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/critical-css | ||
with: | ||
application-image: 'containers.mpi-internal.com/${{ github.repository }}-${{ needs.compute.outputs.APPLICATION_NAME }}-${{ matrix.stage }}:${{ github.sha }}' | ||
- uses: ./.github/composite/dockerize | ||
with: | ||
stage: ${{ matrix.stage }} | ||
suffix: '${{ needs.compute.outputs.APPLICATION_NAME }}-${{ matrix.stage }}-with-critical-css' | ||
cdn: '${{ matrix.CDN }}' | ||
validate-and-publish: | ||
name: 🎯 Validate and Publish | ||
needs: | ||
- compute | ||
- critical-css | ||
# strategy: | ||
# matrix: | ||
# include: | ||
# - environment: 'pre' | ||
# stage: 'development' | ||
# - environment: 'pro' | ||
# stage: 'production' | ||
uses: scmspain/platform-common--actions/.github/workflows/validate-and-publish.yml@v0 | ||
with: | ||
environments: pro | ||
image-tag: containers.mpi-internal.com/${{ github.repository }}-${{ needs.compute.outputs.APPLICATION_NAME }}-production-with-critical-css:${{ github.sha }} | ||
application-name: ms-${{ needs.compute.outputs.APPLICATION_NAME }}--sandbox | ||
bounded-context: ${{ needs.compute.outputs.BOUNDED_CONTEXT }} | ||
secrets: | ||
artifactory-user: ${{ secrets.ARTIFACTORY_USER }} | ||
artifactory-pwd: ${{ secrets.ARTIFACTORY_PWD }} | ||
deploy: | ||
name: 🚀 Deploy | ||
needs: | ||
- compute | ||
- lint | ||
- test-domain | ||
- e2e | ||
- validate-and-publish | ||
permissions: | ||
id-token: write | ||
contents: read | ||
uses: scmspain/platform-common--actions/.github/workflows/deploy.yml@v0 | ||
Check failure on line 359 in .github/workflows/main.yml GitHub Actions / .github/workflows/main.ymlInvalid workflow file
|
||
with: | ||
environment: pro | ||
manifests-path: ${{ needs.validate-and-publish.outputs.manifests-path }} | ||
bounded-context: ${{ needs.compute.outputs.BOUNDED_CONTEXT }} | ||
secrets: | ||
artifactory-user: ${{ secrets.ARTIFACTORY_USER }} | ||
artifactory-pwd: ${{ secrets.ARTIFACTORY_PWD }} | ||
lhci: | ||
name: 🚦Lighthouse | ||
runs-on: big | ||
needs: | ||
- compute | ||
- deploy | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Chrome | ||
id: setup-chrome | ||
uses: scmspain/platform-common--actions/frontend/setup-chrome@v0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: run Lighthouse CI | ||
run: | | ||
npm install -g @lhci/cli@0.14.x | ||
lhci autorun --verbose | ||
env: | ||
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }} | ||
URL_APP: https://ms-pet-movies--sandbox.es-microtest-pro.schip.io | ||
LHCI_BUILD_CONTEXT__ANCESTOR_HASH: ${{ github.event.before }} | ||
LHCI_BUILD_CONTEXT__CURRENT_HASH: ${{ github.sha }} | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: lhci report | ||
path: ./.lighthouseci | ||
retention-days: 30 | ||
- name: Lighthouse CI Compare | ||
uses: adevinta/actions-lighthouseci-compare@v1.1.0 | ||
with: | ||
links-filepath: '.lighthouseci/links.json' | ||
base-url: 'https://lhci-server.es-microtest-pro.schip.io/v1' | ||
project-id: '33489a90-c163-458a-b86d-47555b419fa4' | ||
current-commit-sha: ${{ github.sha }} | ||
should-fail-build: true | ||
notify: | ||
name: 📄 Notify | ||
runs-on: small | ||
if: always() | ||
needs: | ||
- deploy | ||
steps: | ||
- name: Notify | ||
uses: scmspain/platform-common--actions/workflow-status-notification@v0 | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
with: | ||
notify-on: always | ||
slack-channel-id: C0662FGBDGB |