Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk authored Jun 19, 2023
2 parents b2b31f8 + aa94ad8 commit c7ec83a
Show file tree
Hide file tree
Showing 342 changed files with 18,079 additions and 6,700 deletions.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Discord
url: https://per.co.na/discord
about: Please join our discord for quick questions.
- name: Forum
url: https://forums.percona.com/
about: Please join our forums for general questions ans discussions.
107 changes: 56 additions & 51 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Admin
name: 'Client: pmm and pmm-admin'

on:
push:
Expand All @@ -18,25 +18,12 @@ on:
- "update/**"
- "vmproxy/**"

workflow_call:
inputs:
go-version:
description: An array of Go versions to be tested against, in a format of json string.
required: false
type: string
default: '["tip"]'

jobs:
test:
name: Tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(inputs.go-version || '["1.20.x"]') }}

env:
GO_VERSION: ${{ matrix.go-version }}

defaults:
run:
Expand All @@ -47,31 +34,29 @@ jobs:
uses: actions/checkout@v3

- name: Set up Go release
if: env.GO_VERSION != 'tip'
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ github.workspace }}/go.mod
cache: false

- name: Set up Go tip
if: env.GO_VERSION == 'tip'
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
echo "$GOBIN" >> $GITHUB_PATH
- name: Enable Go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-go-build-${{ github.ref }}-
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-modules-

- name: Download Go modules
run: go mod download
run: go mod download -x

- name: Build and install
run: make install
Expand Down Expand Up @@ -101,10 +86,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(inputs.go-version || '["1.20.x"]') }}

env:
GO_VERSION: ${{ matrix.go-version }}
test-type: [ pmm-common, pmm-server-install, pmm-docker-test ]

defaults:
run:
Expand All @@ -115,43 +97,66 @@ jobs:
uses: actions/checkout@v3

- name: Set up Go release
if: env.GO_VERSION != 'tip'
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ github.workspace }}/go.mod
cache: false

- name: Set up Go tip
if: env.GO_VERSION == 'tip'
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
echo "$GOBIN" >> $GITHUB_PATH
- name: Enable Go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-go-build-${{ github.ref }}-
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-modules-

- name: Download Go modules
run: go mod download
run: go mod download -x

- name: Build and install
run: make -C ../admin install

- name: Setup tools
run: |
sudo apt-get install -y wget jq
sudo ln -sf /home/runner/go/bin/pmm /usr/bin
sudo chown -R runner:docker /usr/bin/pmm
- name: Install Playwright
run: |
npm ci
npx playwright install
npm install -D @playwright/test
- name: Run tests
run: npx playwright test --reporter=list tests/pmm-cli/
- name: Run "pmm" common tests
if: ${{ matrix.test-type == 'pmm-common' }}
run: npx playwright test tests/pmm-cli/pmm.spec.ts

- name: Run "pmm server install" tests
if: ${{ matrix.test-type == 'pmm-server-install' }}
run: npx playwright test tests/pmm-cli/server/install.spec.ts

- name: Run "pmm server upgrade" tests
if: ${{ matrix.test-type == 'pmm-server-update' }}
run: npx playwright test tests/pmm-cli/server/upgrade.spec.ts

- name: Run specific docker tests
if: ${{ matrix.test-type == 'pmm-docker-test' }}
run: npx playwright test tests/pmm-cli/server/docker-specific.spec.ts

- name: Attach the report on failure
if: failure()
uses: actions/upload-artifact@v3
with:
name: "report-${{ matrix.go-version }}-${{ matrix.test-type }}"
path: ${{ github.workspace }}/cli-tests/playwright-report/

- name: Run debug commands on failure
if: ${{ failure() }}
Expand Down
47 changes: 16 additions & 31 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Agent
name: 'Client: pmm-agent'

on:
push:
Expand All @@ -19,23 +19,12 @@ on:
- "update/**"
- "vmproxy/**"

workflow_call:
inputs:
go-version:
description: An array of Go versions to be tested against, in a format of json string.
required: false
type: string
default: '["tip"]'

jobs:
test:
name: Tests
runs-on: ubuntu-22.04
strategy:
matrix:
go-version: ${{ fromJson(inputs.go-version || '["1.20.x"]') }}
may-fail: [ true ]

images:
- { mysql: 'mysql:5.6', mongo: 'mongo:4.2', postgres: 'postgres:10', pmm_server: 'percona/pmm-server:2.0.0' }
- { mysql: 'mysql:5.7', mongo: 'mongo:4.4', postgres: 'postgres:11', pmm_server: 'percona/pmm-server:2.0.1' }
Expand All @@ -59,10 +48,9 @@ jobs:
- { mysql: 'mariadb:10.3', mongo: 'percona/percona-server-mongodb:4.4', postgres: 'postgres:9.5', pmm_server: 'perconalab/pmm-server:dev-latest' }
- { mysql: 'mariadb:10.4', postgres: 'postgres:9.6', pmm_server: 'perconalab/pmm-server:dev-latest' }

continue-on-error: ${{ matrix.may-fail }}
continue-on-error: true

env:
GO_VERSION: ${{ matrix.go-version }}
MYSQL_IMAGE: ${{ matrix.images.mysql }}
MONGO_IMAGE: ${{ matrix.images.mongo }}
POSTGRES_IMAGE: ${{ matrix.images.postgres }}
Expand All @@ -78,32 +66,29 @@ jobs:
uses: actions/checkout@v3

- name: Set up Go release
if: env.GO_VERSION != 'tip'
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ github.workspace }}/go.mod
cache: false

- name: Set up Go tip
if: env.GO_VERSION == 'tip'
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Enable Go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-go-build-${{ github.ref }}-
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-modules-

- name: Download Go modules
run: |
pushd ../tools && go mod download
popd && go mod download
run: go mod download -x

- name: Build and install
run: make install
Expand All @@ -121,7 +106,7 @@ jobs:
with:
file: cover.out
flags: agent
env_vars: GO_VERSION,MYSQL_IMAGE,MONGO_IMAGE,POSTGRES_IMAGE,PMM_SERVER_IMAGE
env_vars: MYSQL_IMAGE,MONGO_IMAGE,POSTGRES_IMAGE,PMM_SERVER_IMAGE
fail_ci_if_error: false

- name: Run debug commands on failure
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/go-tip-checks.yml

This file was deleted.

44 changes: 15 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,44 @@ on:

pull_request:

workflow_call:
inputs:
go-version:
description: An array of Go versions to be tested against, in a format of json string.
required: false
type: string
default: '["tip"]'

jobs:
check:
name: Checks
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(inputs.go-version || '["1.20.x"]') }}
may-fail: [ false ]

env:
GO_VERSION: ${{ matrix.go-version }}

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go release
if: env.GO_VERSION != 'tip'
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: ${{ github.workspace }}/go.mod
cache: false

- name: Set up Go tip
if: env.GO_VERSION == 'tip'
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Enable Go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-go-build-${{ github.ref }}-
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-
${{ runner.os }}-go-modules-
- name: Download Go modules
run: |
pushd tools && go mod download
popd && go mod download
pushd tools && go mod download -x
popd && go mod download -x
- name: Install development tools
run: make init
Expand Down Expand Up @@ -98,7 +84,7 @@ jobs:
uses: reviewdog/action-golangci-lint@v2
with:
github_token: ${{ secrets.ROBOT_TOKEN || secrets.GITHUB_TOKEN }}
go_version: ${{ env.GO_VERSION }}
go_version_file: ${{ github.workspace }}/go.mod
reporter: github-pr-review
fail_on_error: true
cache: false
Expand Down
Loading

0 comments on commit c7ec83a

Please sign in to comment.