2021-07-14 15:36:18 +02:00
|
|
|
name: golangci-lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-09-30 21:09:38 +02:00
|
|
|
branches: [ main, release-** ]
|
2021-07-14 15:36:18 +02:00
|
|
|
pull_request:
|
2021-10-01 16:24:21 +02:00
|
|
|
branches: [ main, release-** ]
|
2022-04-20 03:18:47 +02:00
|
|
|
workflow_dispatch:
|
2021-07-14 15:36:18 +02:00
|
|
|
|
2022-07-25 16:01:29 +02:00
|
|
|
env:
|
2022-11-10 18:04:40 +02:00
|
|
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
2022-08-03 11:28:07 +02:00
|
|
|
EXCLUDE_ENTERPRISE: true
|
2022-11-10 18:04:40 +02:00
|
|
|
|
2021-07-14 15:36:18 +02:00
|
|
|
jobs:
|
2022-11-10 18:04:40 +02:00
|
|
|
down-migrations:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: "focalboard"
|
|
|
|
- name: assert that down migrations are SELECT 1 scripts
|
|
|
|
run: |
|
|
|
|
cd focalboard
|
|
|
|
echo 'SELECT 1;' > downmigration
|
|
|
|
for file in server/services/store/sqlstore/migrations/*.down.sql; do diff -Bw downmigration $file; done
|
|
|
|
|
2021-07-14 15:36:18 +02:00
|
|
|
golangci:
|
2022-04-20 03:18:47 +02:00
|
|
|
name: plugin
|
2021-07-14 15:36:18 +02:00
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
2022-04-20 03:18:47 +02:00
|
|
|
- uses: actions/setup-go@v3
|
2021-07-14 15:36:18 +02:00
|
|
|
with:
|
2023-01-23 09:13:40 +02:00
|
|
|
go-version: 1.19.5
|
2022-04-20 03:18:47 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-25 16:01:29 +02:00
|
|
|
with:
|
|
|
|
path: "focalboard"
|
|
|
|
- id: "mattermostServer"
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
repository: "mattermost/mattermost-server"
|
2022-11-10 18:04:40 +02:00
|
|
|
fetch-depth: "20"
|
2022-07-25 16:01:29 +02:00
|
|
|
path: "mattermost-server"
|
|
|
|
ref: ${{ env.BRANCH_NAME }}
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
if: steps.mattermostServer.outcome == 'failure'
|
|
|
|
with:
|
|
|
|
repository: "mattermost/mattermost-server"
|
2022-11-10 18:04:40 +02:00
|
|
|
fetch-depth: "20"
|
2022-07-25 16:01:29 +02:00
|
|
|
path: "mattermost-server"
|
2023-03-27 23:47:32 +02:00
|
|
|
ref : "b61c096497ac1f22f64b77afe58d0dd5a72b38f1"
|
2022-04-20 03:18:47 +02:00
|
|
|
- name: set up golangci-lint
|
2023-01-23 09:13:40 +02:00
|
|
|
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1
|
2022-04-20 03:18:47 +02:00
|
|
|
- name: lint
|
2022-07-25 16:08:02 +02:00
|
|
|
run: |
|
|
|
|
cd focalboard
|
|
|
|
make server-lint
|