generated from Brightscout/mattermost-plugin-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from CircleCI to Github actions
We can use across all the repositories of plugins and apps the same reusable workflow which give us the ability to change only one file instead of multiple and apart from this the ability to use different versions as we prefer. Ticket: https://mattermost.atlassian.net/browse/CLD-4816
- Loading branch information
Showing
3 changed files
with
29 additions
and
134 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: cd | ||
on: | ||
workflow_run: | ||
workflows: ["ci"] | ||
types: | ||
- completed | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
plugin-cd: | ||
uses: mattermost/actions-workflows/.github/workflows/plugin-cd.yml@master | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,18 @@ | ||
# Continuous Integration Workflow to check pushes to master and pull requests: | ||
# - code style guidelines are followed (make check-style) | ||
# - tests pass (make test) | ||
# - code builds (make dist) | ||
name: CI | ||
|
||
name: ci | ||
on: | ||
pull_request: | ||
schedule: # nightly builds | ||
- cron: "0 0 * * *" | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
name: Check style; build; test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go v1.16.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16.x | ||
|
||
- name: Set up Node.js v14.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Install golangci | ||
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0 | ||
|
||
- name: Cache go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install webapp dependencies | ||
run: make webapp/node_modules | ||
env: | ||
TERM: dumb | ||
|
||
- name: check style | ||
run: make check-style | ||
env: | ||
TERM: dumb | ||
|
||
- name: run tests | ||
run: make test | ||
env: | ||
TERM: dumb | ||
|
||
- name: Build and bundle the plugin | ||
id: build | ||
run: | | ||
make dist | ||
echo ::set-output name=BUNDLE_NAME::$(cd dist; ls *.tar.gz) | ||
env: | ||
TERM: dumb | ||
permissions: | ||
contents: read | ||
|
||
- name: Upload the built plugin as an artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.build.outputs.BUNDLE_NAME }} | ||
path: dist/${{ steps.build.outputs.BUNDLE_NAME }} | ||
jobs: | ||
plugin-ci: | ||
uses: mattermost/actions-workflows/.github/workflows/plugin-ci.yml@master | ||
secrets: inherit |