mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-09 22:04:43 +00:00
feat: add CI workflow for linting and building CLI, UI, and Android artifacts
This commit is contained in:
114
.github/workflows/ci.yml
vendored
Normal file
114
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "master" ]
|
||||
pull_request:
|
||||
branches: [ "main", "master" ]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: latest
|
||||
args: --timeout=5m
|
||||
|
||||
build-cli:
|
||||
name: Build CLI (Binaries)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
|
||||
- name: Install Mage
|
||||
run: go install github.com/magefile/mage@latest
|
||||
|
||||
- name: Build CLI (Cross)
|
||||
run: mage cross
|
||||
|
||||
- name: Upload CLI Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: olcrtc-cli-binaries
|
||||
path: build/
|
||||
|
||||
build-ui:
|
||||
name: Build UI (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
|
||||
- name: Install Linux Dependencies (Fyne)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev libwayland-dev libx11-dev
|
||||
|
||||
- name: Install Mage
|
||||
run: go install github.com/magefile/mage@latest
|
||||
|
||||
- name: Build UI
|
||||
run: mage buildUI
|
||||
|
||||
- name: Upload UI Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: olcrtc-ui-${{ runner.os }}
|
||||
path: build/
|
||||
|
||||
build-android:
|
||||
name: Build Android (AAR)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25.x'
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Install gomobile
|
||||
run: |
|
||||
go install golang.org/x/mobile/cmd/gomobile@latest
|
||||
gomobile init
|
||||
|
||||
- name: Install Mage
|
||||
run: go install github.com/magefile/mage@latest
|
||||
|
||||
- name: Build Mobile
|
||||
run: mage mobile
|
||||
|
||||
- name: Upload Android Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: olcrtc-android
|
||||
path: build/olcrtc.aar
|
||||
Reference in New Issue
Block a user