Skip to content

Commit

Permalink
Add linting to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mircearoata committed Dec 10, 2023
1 parent d9d3575 commit be9dda8
Showing 1 changed file with 50 additions and 35 deletions.
85 changes: 50 additions & 35 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,76 +9,91 @@ env:
PNPM_VERSION: "8.6.1"

jobs:
linux:
name: Build (Linux)
runs-on: ubuntu-20.04
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
artifactName: linux
buildArgs: ''
- os: windows-latest
artifactName: windows
buildArgs: -nsis
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: frontend

- name: Install Dependencies
- name: Install additional dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt -y install libgtk-3-dev libwebkit2gtk-4.0-dev
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest

- name: Build
run: wails build
run: wails build ${{ matrix.buildArgs }}

- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: linux
name: ${{ matrix.artifactName }}
path: build/bin/*

windows:
name: Build (Windows)
runs-on: windows-latest
lint-backend:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- uses: pnpm/action-setup@v2
- uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.PNPM_VERSION }}
version: v1.54
only-new-issues: true
skip-pkg-cache: true
skip-build-cache: true

lint-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: frontend

- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest

- name: Build
run: wails build -nsis

- name: Archive artifacts
uses: actions/upload-artifact@v3
- uses: pnpm/action-setup@v2
with:
name: windows
path: build/bin/*
version: ${{ env.PNPM_VERSION }}

- name: Install dependencies
working-directory: frontend
run: pnpm install

- name: Lint
working-directory: frontend
run: |
pnpm lint
# disable check for now, as SMUI causes an error
# pnpm check

0 comments on commit be9dda8

Please sign in to comment.