Skip to content

style: add markdownlint #4

style: add markdownlint

style: add markdownlint #4

name: Build and Test Pipeline
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
- name: Set up Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version-file: .nvmrc
check-latest: false
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Linter
run: npm run lint
test:
name: Testing on ${{ matrix.os }}
needs:
- lint
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
- name: Set up Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version-file: .nvmrc
check-latest: false
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: npm run coverage
# release:
# name: Build Docker Image and Release
# needs:
# - test
# runs-on: ubuntu-latest
# permissions:
# actions: read
# contents: write
# packages: write
# id-token: write
# steps:
# - name: Checkout Repository
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# show-progress: false
# - name: Docker Login to GitHub Repository
# uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Docker Login to DockerHub
# uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
# with:
# username: ${{ secrets.BOT_DOCKER_USERNAME }}
# password: ${{ secrets.BOT_DOCKER_TOKEN }}
# - name: Docker Login to Mia registry
# uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
# with:
# registry: nexus.mia-platform.eu
# username: ${{ secrets.NEXUS_USER }}
# password: ${{ secrets.NEXUS_TOKEN }}
# - name: Set up QEMU
# uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
# with:
# platforms: amd64,arm64
# - name: Configure Docker Metadata
# id: meta
# uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
# env:
# DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
# with:
# images: |
# ghcr.io/mia-platform/console-mcp-server
# docker.io/miaplatform/console-mcp-server
# nexus.mia-platform.eu/core/console-mcp-server
# tags: |
# type=ref,event=branch
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
# type=semver,pattern={{major}}
# labels: |
# org.opencontainers.image.authors=Mia Platform Core Team<[email protected]>
# org.opencontainers.image.documentation=https://docs.mia-platform.eu/docs/marketplace/handbooks/crud-oss-usage
# org.opencontainers.image.vendor=Mia s.r.l.
# annotations: |
# org.opencontainers.image.authors=Mia Platform Core Team<[email protected]>
# org.opencontainers.image.documentation=https://docs.mia-platform.eu/docs/marketplace/handbooks/crud-oss-usage
# org.opencontainers.image.vendor=Mia s.r.l.
# - name: Setup Buildx Context
# uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
# id: buildx
# with:
# platforms: linux/amd64,linux/arm64
# - name: Build and Push
# id: docker-build
# uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# annotations: ${{ steps.meta.output.annotations }}
# platforms: ${{ steps.buildx.outputs.platforms }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
# - name: Install Cosign
# uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
# - name: GCP Auth
# uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 # v2.1.8
# if: github.ref_type == 'tag'
# with:
# project_id: ${{ secrets.MIA_PLATFORM_KMS_GCP_PROJECT }}
# workload_identity_provider: ${{ secrets.MIA_PLATFORM_WIF }}
# create_credentials_file: true
# - name: Generate SBOM
# uses: anchore/sbom-action@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0
# with:
# artifact-name: console-mcp-server-sbom.spdx.json
# output-file: ./console-mcp-server-sbom.spdx.json
# image: nexus.mia-platform.eu/core/console-mcp-server:${{ steps.meta.output.version.main }}
# upload-release-assets: true
# - name: Sign image with a key
# run: |
# images=""
# for tag in ${TAGS}; do
# images+="${tag}@${DIGEST} "
# done
# cosign sign --recursive --yes --key env://COSIGN_PRIVATE_KEY ${images}
# cosign attest --recursive --yes --key env//COSIGN_PRIVATE_KEY --predicate "console-mcp-server-sbom.spdx.json" --type="spdxjson" ${images}
# env:
# TAGS: |
# ghcr.io/mia-platform/console-mcp-server:${{ steps.meta.output.version.main }}
# docker.io/miaplatform/console-mcp-server:${{ steps.meta.output.version.main }}
# nexus.mia-platform.eu/core/console-mcp-server:${{ steps.meta.output.version.main }}
# COSIGN_PRIVATE_KEY: ${{ secrets.MIA_PLATFORM_KEY_KMS }}
# DIGEST: ${{ steps.docker-build.outputs.digest }}