[EMBR-6544] chore(dependencies*): update all dependencies #258
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
release: | |
types: [released, prereleased] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --prefer-offline | |
- name: Check types | |
run: npm run typecheck | |
- name: Lint | |
run: npm run lint | |
- name: Unit tests | |
run: npm run test:ci | |
e2e-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --prefer-offline | |
- name: Build dependencies | |
run: npm run build | |
- name: Start Grafana container | |
run: docker compose --file compose.yaml up --detach | |
- name: Run e2e tests | |
run: npm run e2e | |
- name: Stop Grafana container | |
run: docker compose --file compose.yaml down | |
build: | |
runs-on: ubuntu-latest | |
needs: | |
- tests | |
- e2e-tests | |
if: ${{ github.event_name == 'release' && contains(fromJSON('["released", "prereleased"]'), github.event.action) }} | |
env: | |
FILENAME: embraceio-metric-app-${{ github.event.release.tag_name }}.zip | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
# - name: Update version in package.json and plugin.json | |
# run: | | |
# sed -i 's/"version": "0.0.0"/"version": "${{ github.event.release.tag_name }}"/g' package.json src/plugin.json | |
- name: Install dependencies | |
run: npm ci --prefer-offline | |
- name: Build dependencies | |
run: npm run build | |
- name: Sign Grafana plugin | |
run: npx @grafana/sign-plugin | |
env: | |
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }} | |
- name: Rename dist directory | |
run: mv dist/ embraceio-metric-app/ | |
- name: Zip app directory | |
run: zip -r $FILENAME ./embraceio-metric-app | |
- name: Generate MD5 hash file | |
run: echo "$(md5sum ./$FILENAME | awk '{print $1}')" > md5.txt | |
- name: Upload release | |
run: gh release upload "${{ github.event.release.tag_name }}" $FILENAME md5.txt --clobber | |
env: | |
GH_TOKEN: ${{ github.token }} |