Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryk-dk committed Feb 12, 2024
1 parent d582180 commit 4aa393b
Show file tree
Hide file tree
Showing 9 changed files with 407 additions and 134 deletions.
90 changes: 0 additions & 90 deletions .github/workflows/ci.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Update docs

on:
push:
branches:
- main
paths:
- ".github/workflows/docs.yaml"
- "README.md"
- "docs/**"

jobs:
update-docs:
runs-on: ubuntu-latest
environment:
name: docs
url: https://docs.victoriametrics.com/
steps:
- name: Check out code
uses: actions/checkout@v4
with:
repository: VictoriaMetrics/grafana-logs-datasource
ref: main
token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: "__vm-datasource-repo"

- name: Check out VM code
uses: actions/checkout@v4
with:
repository: VictoriaMetrics/VictoriaMetrics
ref: master
token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: "__vm-docs-repo"

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
workdir: "__vm-docs-repo"

# Copies README.md and assets from docs/assets
- name: Update ds docs in VM repo
run: |
echo '---
sort: 38
weight: 38
title: Grafana logs datasource
menu:
docs:
parent: 'victorialogs'
weight: 38
aliases:
- /grafana-logs-datasource.html
---
' > ../__vm-docs-repo/docs/grafana-logs-datasource.md
cat ./README.md >> ../__vm-docs-repo/docs/grafana-logs-datasource.md
sed -i 's|docs/assets/||g' ../__vm-docs-repo/docs/grafana-logs-datasource.md
cp docs/assets/* ../__vm-docs-repo/docs/
working-directory: "__vm-datasource-repo"

- name: Commit and push changes
run: |
export VM_GIT_BRANCH_NAME="ds-docs-update-$(date +%s)"
export VM_GIT_COMMIT_SHA="$(git rev-parse --short $GITHUB_SHA)"
git checkout -b "${VM_GIT_BRANCH_NAME}"
git add docs/
git commit -S -m "Automatic update Grafana logs datasource docs from ${GITHUB_REPOSITORY}@${VM_GIT_COMMIT_SHA}"
git push origin ${VM_GIT_BRANCH_NAME}
gh pr create -f
working-directory: "__vm-docs-repo"
env:
GITHUB_TOKEN: ${{ secrets.VM_BOT_GH_TOKEN }}
19 changes: 0 additions & 19 deletions .github/workflows/is-compatible.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/pr-checks-golang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: main
on:
push:
branches:
- main
paths-ignore:
- "src/**"
- "**.md"
pull_request:
branches:
- main
paths-ignore:
- "src/**"
- "**.md"
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.21.5
check-latest: true
cache: true

- name: Dependencies
run: |
make check-all
git diff --exit-code
test:
needs: lint
strategy:
matrix:
scenario: ["golang-test", "golang-test-race"]
name: test
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.2
check-latest: true
cache: true

- name: run tests
run: |
make ${{ matrix.scenario}}
build:
needs: test
name: build
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3

- name: Setup Go
id: go
uses: actions/setup-go@v3
with:
go-version: 1.21.5
check-latest: true
cache: true

- uses: actions/cache@v3
with:
path: gocache-for-docker
key: gocache-docker-${{ runner.os }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.mod') }}

- name: Build
run: |
make victorialogs-backend-plugin-build
67 changes: 67 additions & 0 deletions .github/workflows/pr-checks-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Name of this action
name: check frontend

# Event triggers on pull request event
# For more detail visit https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
on:
push:
branches: [ main ]
paths:
- '**/*.ts'
- '**/*.tsx'
pull_request:
branches: [main]
paths:
- '**/*.ts'
- '**/*.tsx'

# The jobs this action will run. You can write as many jobs as you want.
# For more detail on this section visit https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobs
jobs:
# ID of the job
run-jest-tests:
# Name of the job as it will be displayed in GitHub
name: Jest Tests
# Machine which this action will be run on. For a list of all the machines available/how to run on self hosted machine visit
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest

# Steps this job must take to complete
steps:
# Reference the main branch. For more information visit https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsuses
- name: Checkout under $GITHUB_WORKSPACE
uses: actions/checkout@main

# Specify which version of Node this project is using. For more information visit.
# https://docs.github.com/en/actions/guides/building-and-testing-nodejs#specifying-the-nodejs-version
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 18.13.0

- name: Install all dependencies
run: yarn install

- name: Run Jest Tests
run: npm run test

run-build:
needs: run-jest-tests
name: build
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 18.13.0

- name: Install all dependencies
run: yarn install

- name: Build
shell: 'script -q -e -c "bash {0}"'
run: |
make victorialogs-frontend-plugin-build
Loading

0 comments on commit 4aa393b

Please sign in to comment.