Skip to content

Commit

Permalink
Migrate from CircleCI to Github actions
Browse files Browse the repository at this point in the history
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
spirosoik committed Jan 10, 2023
1 parent a6073ba commit c392122
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 134 deletions.
63 changes: 0 additions & 63 deletions .circleci/config.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/cd.yml
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
83 changes: 12 additions & 71 deletions .github/workflows/ci.yml
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

0 comments on commit c392122

Please sign in to comment.