Skip to content

Merge pull request #600 from ictsc/renovate/eslint-plugin-react-refre… #1732

Merge pull request #600 from ictsc/renovate/eslint-plugin-react-refre…

Merge pull request #600 from ictsc/renovate/eslint-plugin-react-refre… #1732

Workflow file for this run

name: Proto CI Pipeline
on:
push:
branches:
- main
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: proto
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run buf-lint
uses: bufbuild/buf-lint-action@v1
with:
input: proto
- name: Setup Node
uses: actions/setup-node@v4
- name: Install spectral
run: npm install --location=global @stoplight/spectral-cli
- name: Run spectral
run: spectral lint ./**/v1/*.yaml --ruleset .spectral.yaml --fail-severity warn
breaking:
name: Check Breaking Changes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run buf-breaking
uses: bufbuild/buf-action@v1
with:
input: proto
breaking: true
breaking_against: https://github.com/ictsc/ictsc-regalia.git#branch=main,subdir=proto
format:
name: Format
runs-on: ubuntu-latest
defaults:
run:
working-directory: proto
steps:
- name: Generate a token
id: token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PUSHER_APP_ID }}
private-key: ${{ secrets.PUSHER_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.token.outputs.token }}
- name: Install buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Format
run: |
buf format --write
- name: Push
id: push
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "run buf format"
branch: ${{ github.head_ref }}
commit_user_name: ictsc-actions[bot]
commit_user_email: 154957684+ictsc-actions[bot]@users.noreply.github.com
commit_author: ictsc-actions[bot] <154957684+ictsc-actions[bot]@users.noreply.github.com>
- name: Exit with Error If Files Are Changed
if: steps.push.outputs.changes_detected == 'true'
run: exit 1
generate:
name: Generation
runs-on: ubuntu-latest
needs: format
steps:
- name: Generate a token
id: token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PUSHER_APP_ID }}
private-key: ${{ secrets.PUSHER_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.token.outputs.token }}
# Setup backend
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
- name: Install buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Setup frontend
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: frontend/package.json
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
working-directory: frontend
run: pnpm install
# Generate
- name: Generate backend
run: task generate
- name: Generate frontend
working-directory: frontend
run: pnpm generate:proto
- name: Push
id: push
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "generate & oapi files"
branch: ${{ github.head_ref }}
commit_user_name: ictsc-actions[bot]
commit_user_email: 154957684+ictsc-actions[bot]@users.noreply.github.com
commit_author: ictsc-actions[bot] <154957684+ictsc-actions[bot]@users.noreply.github.com>
- name: Exit with Error If Files Are Changed
if: steps.push.outputs.changes_detected == 'true'
run: exit 1