Skip to content
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

feat: Upgrade components on reusable plugin actions #22

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plugin-ci/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ description: |
runs:
using: "composite"
steps:
- name: ci/build
- name: build-plugin
shell: bash
run: make dist
env:
CGO_ENABLED: "0"

- name: ci/release-notes
- name: generate-release-notes
shell: bash
run: |
printf "Supported Mattermost Server Versions: **$(cat plugin.json | jq .min_server_version -r)+** \n## Enhancements\n\n## Fixes\n" >> dist/release-notes.md
Expand All @@ -22,7 +22,8 @@ runs:
git log --pretty='format:- %h %s' --abbrev-commit --no-decorate --no-color $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..HEAD >> dist/release-notes.md
fi

- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
- name: upload-plugin-package
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: dist
path: |
Expand Down
10 changes: 5 additions & 5 deletions plugin-ci/lint/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ description: |
runs:
using: "composite"
steps:
- name: ci/check-style
- name: check-style
shell: bash
run: make check-style

- name: ci/tidy-mod
- name: tidy-mod
shell: bash
run: go mod tidy -v

- name: ci/diff-mod
- name: diff-mod
shell: bash
run: |
git --no-pager diff --exit-code go.mod go.sum || (echo "Please run \"go mod tidy\" and commit the changes in go.mod and go.sum." && exit 1)

- name: ci/apply
- name: apply
shell: bash
run: make apply

- name: ci/diff-manifests
- name: diff-manifests
shell: bash
run: |
git --no-pager diff --exit-code *manifest.* || (echo "Please run \"make apply\" and commit the changes in the generated manifests." && exit 1)
23 changes: 8 additions & 15 deletions plugin-ci/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ inputs:
The version to use for golangci-lint
required: false

golang-cache-enabled:
default: "true"
description: |
Enable golang caching in CI
required: false

golang-version:
default: "1.21"
description: |
Expand All @@ -29,7 +23,7 @@ inputs:
runs:
using: "composite"
steps:
- name: Check for webapp
- name: check-if-plugin-has-webapp
id: webapp_check
shell: bash
run: |
Expand All @@ -39,21 +33,20 @@ runs:
echo "exist=false" >> $GITHUB_OUTPUT
fi

- name: Install Node
- name: install-node
if: steps.webapp_check.outputs.exist == 'true'
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: webapp/package-lock.json

- name: Install golangci-lint
- name: setup-go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ inputs.golang-version }}

- name: install-golangci-lint
shell: bash
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${{ inputs.golangci-lint-version }}

- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ inputs.golang-version }}
cache: ${{ inputs.golang-cache-enabled }}
7 changes: 4 additions & 3 deletions plugin-ci/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ description: |
runs:
using: "composite"
steps:
- name: ci/test
- name: test-plugin
shell: bash
run: make test

- name: ci/goverage
- name: generate-goverage
shell: bash
run: make coverage

- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
- name: upload-coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
files: server/coverage.txt