|
17 | 17 | with:
|
18 | 18 | node-version: '12.x'
|
19 | 19 |
|
| 20 | + - name: Setup Go environment |
| 21 | + uses: actions/setup-go@v2 |
| 22 | + with: |
| 23 | + go-version: '1.14' |
| 24 | + |
20 | 25 | - name: Get yarn cache directory path
|
21 | 26 | id: yarn-cache-dir-path
|
22 | 27 | run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
45 | 50 | steps.cache-yarn-cache.outputs.cache-hit != 'true' ||
|
46 | 51 | steps.cache-node-modules.outputs.cache-hit != 'true'
|
47 | 52 |
|
48 |
| - - name: Build plugin |
| 53 | + - name: Build and test frontend |
49 | 54 | run: yarn build
|
50 | 55 |
|
| 56 | + - name: Check for backend |
| 57 | + id: check-for-backend |
| 58 | + run: | |
| 59 | + if [ -f "Magefile.go" ] |
| 60 | + then |
| 61 | + echo "::set-output name=has-backend::true" |
| 62 | + fi |
| 63 | +
|
| 64 | + - name: Test backend |
| 65 | + if: steps.check-for-backend.outputs.has-backend == 'true' |
| 66 | + uses: magefile/mage-action@v1 |
| 67 | + with: |
| 68 | + version: latest |
| 69 | + args: coverage |
| 70 | + |
| 71 | + - name: Build backend |
| 72 | + if: steps.check-for-backend.outputs.has-backend == 'true' |
| 73 | + uses: magefile/mage-action@v1 |
| 74 | + with: |
| 75 | + version: latest |
| 76 | + args: buildAll |
| 77 | + |
51 | 78 | - name: Sign plugin
|
52 | 79 | run: yarn run grafana-toolkit plugin:sign
|
53 | 80 | env:
|
@@ -83,18 +110,13 @@ jobs:
|
83 | 110 | md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }}
|
84 | 111 | echo "::set-output name=checksum::$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)"
|
85 | 112 |
|
86 |
| - - name: Setup Go environment |
87 |
| - uses: actions/setup-go@v2 |
88 |
| - with: |
89 |
| - go-version: '1.14.12' |
90 |
| - |
91 | 113 | - name: Lint plugin
|
92 | 114 | run: |
|
93 |
| - git clone https://github.com/grafana/plugin-validator; |
94 |
| - pushd ./plugin-validator/cmd/plugincheck; |
| 115 | + git clone https://github.com/grafana/plugin-validator |
| 116 | + pushd ./plugin-validator/cmd/plugincheck |
95 | 117 | go install
|
96 | 118 | popd
|
97 |
| - plugincheck ${{ steps.metadata.outputs.archive }}; |
| 119 | + plugincheck ${{ steps.metadata.outputs.archive }} |
98 | 120 |
|
99 | 121 | - name: Create release
|
100 | 122 | id: create_release
|
@@ -133,4 +155,4 @@ jobs:
|
133 | 155 | run: |
|
134 | 156 | echo Publish your plugin to grafana.com/plugins by opening a PR to https://github.com/grafana/grafana-plugin-repository with the following entry:
|
135 | 157 | echo
|
136 |
| - echo '{ "id": "${{ steps.metadata.outputs.plugin-id }}", "type": "${{ steps.metadata.outputs.plugin-type }}", "url": "https://github.com/${{ github.repository }}", "versions": [ { "version": "${{ steps.metadata.outputs.plugin-version }}", "commit": "${{ github.sha }}", "url": "https://github.com/${{ github.repository }}", "download": { "any": { "url": "${{ steps.upload-plugin-asset.outputs.browser_download_url }}", "md5": "${{ steps.metadata.package-plugin.checksum }}" } } } ] }' | jq . |
| 158 | + echo '{ "id": "${{ steps.metadata.outputs.plugin-id }}", "type": "${{ steps.metadata.outputs.plugin-type }}", "url": "https://github.com/${{ github.repository }}", "versions": [ { "version": "${{ steps.metadata.outputs.plugin-version }}", "commit": "${{ github.sha }}", "url": "https://github.com/${{ github.repository }}", "download": { "any": { "url": "${{ steps.upload-plugin-asset.outputs.browser_download_url }}", "md5": "${{ steps.package-plugin.outputs.checksum }}" } } } ] }' | jq . |
0 commit comments