-
Notifications
You must be signed in to change notification settings - Fork 29
github actions workflows added #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3f917f5
github actions workflows added
yesoreyeram dd0a503
added playwright tests
yesoreyeram b12f9fd
Merge branch 'main' into sriram/drone-to-gha-migrations
zoltanbedi 2bae00e
Merge branch 'main' into sriram/drone-to-gha-migrations
zoltanbedi c0be995
Update push.yaml
zoltanbedi 87c9b67
Update .gitignore and playwright.config.ts to include EOL
zoltanbedi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Plugins - CD | ||
run-name: Deploy ${{ inputs.branch }} to ${{ inputs.environment }} by @${{ github.actor }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: Branch to publish from. Can be used to deploy PRs to dev | ||
default: main | ||
environment: | ||
description: Environment to publish to | ||
required: true | ||
type: choice | ||
options: | ||
- 'dev' | ||
- 'ops' | ||
- 'prod' | ||
docs-only: | ||
description: Only publish docs, do not publish the plugin | ||
default: false | ||
type: boolean | ||
|
||
jobs: | ||
cd: | ||
name: CD | ||
uses: grafana/plugin-ci-workflows/.github/workflows/cd.yml@main | ||
with: | ||
branch: ${{ github.event.inputs.branch }} | ||
environment: ${{ github.event.inputs.environment }} | ||
docs-only: ${{ fromJSON(github.event.inputs.docs-only) }} | ||
run-playwright: true |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Plugins - CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
uses: grafana/plugin-ci-workflows/.github/workflows/ci.yml@main | ||
with: | ||
plugin-version-suffix: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }} | ||
run-playwright: true |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
node_modules/ | ||
coverage/ | ||
ci/ | ||
cypress/fixtures/jwt.json | ||
cypress/report.json | ||
cypress/screenshots/actual | ||
cypress/videos/ | ||
dist/ | ||
provisioning | ||
.eslintcache | ||
__debug_bin | ||
|
||
# playwright | ||
test-results/ | ||
playwright-report/ | ||
blob-report/ | ||
playwright/.cache/ | ||
playwright/.auth/ |
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import type { PluginOptions } from '@grafana/plugin-e2e'; | ||
import { defineConfig, devices } from '@playwright/test'; | ||
import { dirname } from 'node:path'; | ||
|
||
const pluginE2eAuth = `${dirname(require.resolve('@grafana/plugin-e2e'))}/auth`; | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
// require('dotenv').config(); | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig<PluginOptions>({ | ||
testDir: './tests', | ||
/* Run tests in files in parallel */ | ||
fullyParallel: true, | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: !!process.env.CI, | ||
/* Retry on CI only */ | ||
retries: process.env.CI ? 2 : 0, | ||
/* Opt out of parallel tests on CI. */ | ||
workers: process.env.CI ? 1 : undefined, | ||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
reporter: 'html', | ||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
use: { | ||
/* Base URL to use in actions like `await page.goto('/')`. */ | ||
baseURL: 'http://localhost:3000', | ||
|
||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: 'on-first-retry', | ||
}, | ||
|
||
/* Configure projects for major browsers */ | ||
projects: [ | ||
// 1. Login to Grafana and store the cookie on disk for use in other tests. | ||
{ | ||
name: 'auth', | ||
testDir: pluginE2eAuth, | ||
testMatch: [/.*\.js/], | ||
}, | ||
// 2. Run tests in Google Chrome. Every test will start authenticated as admin user. | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'], storageState: 'playwright/.auth/admin.json' }, | ||
dependencies: ['auth'], | ||
}, | ||
], | ||
}); |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.