Unify CI and justfile: all workflows call just recipes
Some checks failed
CI / Scraper / Test (pull_request) Failing after 9s
CI / UI / Build (pull_request) Failing after 9s
CI / Scraper / Lint (pull_request) Failing after 12s
CI / Scraper / Build (pull_request) Has been skipped
iOS CI / Build (push) Has been cancelled
iOS CI / Test (push) Has been cancelled
iOS CI / Build (pull_request) Failing after 2s
iOS CI / Test (pull_request) Has been skipped

- justfile: extract ios_scheme/ios_sim/ios_spm/runner_temp variables; add
  ios-resolve (SPM dep cache), ios-archive, ios-export recipes; pipe xcodebuild
  through xcpretty with raw fallback in ios-build/ios-test
- ios.yaml: replace raw xcodebuild calls with just ios-build / just ios-test;
  install just via brew; uncommented archive job stub now calls just ios-archive
  && just ios-export; add justfile to path trigger
- ci-scraper.yaml: install just via extractions/setup-just@v2; use just lint /
  just test; fix upload-artifact v3 -> v4; add justfile to path trigger
- ci-ui.yaml: install just; use just ui-install / just ui-check / just ui-build;
  add justfile to path trigger
This commit is contained in:
Admin
2026-03-07 18:23:38 +05:00
parent f51113a2f8
commit 992eb823f2
4 changed files with 98 additions and 109 deletions

View File

@@ -5,17 +5,15 @@ on:
branches: ["main", "master"] branches: ["main", "master"]
paths: paths:
- "scraper/**" - "scraper/**"
- "justfile"
- ".gitea/workflows/ci-scraper.yaml" - ".gitea/workflows/ci-scraper.yaml"
pull_request: pull_request:
branches: ["main", "master"] branches: ["main", "master"]
paths: paths:
- "scraper/**" - "scraper/**"
- "justfile"
- ".gitea/workflows/ci-scraper.yaml" - ".gitea/workflows/ci-scraper.yaml"
defaults:
run:
working-directory: scraper
jobs: jobs:
# ── lint & vet ─────────────────────────────────────────────────────────────── # ── lint & vet ───────────────────────────────────────────────────────────────
lint: lint:
@@ -29,11 +27,11 @@ jobs:
go-version-file: scraper/go.mod go-version-file: scraper/go.mod
cache-dependency-path: scraper/go.sum cache-dependency-path: scraper/go.sum
- name: go vet - name: Install just
run: go vet ./... uses: extractions/setup-just@v2
- name: staticcheck - name: go vet
run: go tool staticcheck ./... run: just lint
# ── tests ──────────────────────────────────────────────────────────────────── # ── tests ────────────────────────────────────────────────────────────────────
test: test:
@@ -47,8 +45,11 @@ jobs:
go-version-file: scraper/go.mod go-version-file: scraper/go.mod
cache-dependency-path: scraper/go.sum cache-dependency-path: scraper/go.sum
- name: Install just
uses: extractions/setup-just@v2
- name: Run tests - name: Run tests
run: go test -race -count=1 -timeout=60s ./... run: just test
# ── build binary ───────────────────────────────────────────────────────────── # ── build binary ─────────────────────────────────────────────────────────────
build: build:
@@ -63,13 +64,16 @@ jobs:
go-version-file: scraper/go.mod go-version-file: scraper/go.mod
cache-dependency-path: scraper/go.sum cache-dependency-path: scraper/go.sum
- name: Install just
uses: extractions/setup-just@v2
- name: Build binary - name: Build binary
run: | run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ cd scraper && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -ldflags="-s -w" -o bin/scraper ./cmd/scraper go build -ldflags="-s -w" -o bin/scraper ./cmd/scraper
- name: Upload binary artifact - name: Upload binary artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: scraper-linux-amd64 name: scraper-linux-amd64
path: scraper/bin/scraper path: scraper/bin/scraper

View File

@@ -5,17 +5,15 @@ on:
branches: ["main", "master"] branches: ["main", "master"]
paths: paths:
- "ui/**" - "ui/**"
- "justfile"
- ".gitea/workflows/ci-ui.yaml" - ".gitea/workflows/ci-ui.yaml"
pull_request: pull_request:
branches: ["main", "master"] branches: ["main", "master"]
paths: paths:
- "ui/**" - "ui/**"
- "justfile"
- ".gitea/workflows/ci-ui.yaml" - ".gitea/workflows/ci-ui.yaml"
defaults:
run:
working-directory: ui
jobs: jobs:
# ── type-check & build ─────────────────────────────────────────────────────── # ── type-check & build ───────────────────────────────────────────────────────
build: build:
@@ -30,11 +28,14 @@ jobs:
cache: npm cache: npm
cache-dependency-path: ui/package-lock.json cache-dependency-path: ui/package-lock.json
- name: Install just
uses: extractions/setup-just@v2
- name: Install dependencies - name: Install dependencies
run: npm ci run: just ui-install
- name: Type check - name: Type check
run: npm run check run: just ui-check
- name: Build - name: Build
run: npm run build run: just ui-build

View File

@@ -5,17 +5,15 @@ on:
branches: ["v2", "main"] branches: ["v2", "main"]
paths: paths:
- "ios/**" - "ios/**"
- "justfile"
- ".gitea/workflows/ios.yaml" - ".gitea/workflows/ios.yaml"
pull_request: pull_request:
branches: ["v2", "main"] branches: ["v2", "main"]
paths: paths:
- "ios/**" - "ios/**"
- "justfile"
- ".gitea/workflows/ios.yaml" - ".gitea/workflows/ios.yaml"
defaults:
run:
working-directory: ios/LibNovel
jobs: jobs:
# ── build ───────────────────────────────────────────────────────────────── # ── build ─────────────────────────────────────────────────────────────────
build: build:
@@ -25,36 +23,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install just
run: brew install just
- name: Install xcodegen - name: Install xcodegen
run: brew install xcodegen run: brew install xcodegen
- name: Generate Xcode project
run: xcodegen generate --spec project.yml --project .
- name: Resolve SPM packages
run: |
xcodebuild \
-project LibNovel.xcodeproj \
-scheme LibNovel \
-resolvePackageDependencies \
-clonedSourcePackagesDirPath .spm-cache
- name: Build (simulator) - name: Build (simulator)
run: | run: just ios-build
xcodebuild \
-project LibNovel.xcodeproj \
-scheme LibNovel \
-configuration Debug \
-destination 'generic/platform=iOS Simulator' \
-clonedSourcePackagesDirPath .spm-cache \
CODE_SIGNING_ALLOWED=NO \
| xcpretty || xcodebuild \
-project LibNovel.xcodeproj \
-scheme LibNovel \
-configuration Debug \
-destination 'generic/platform=iOS Simulator' \
-clonedSourcePackagesDirPath .spm-cache \
CODE_SIGNING_ALLOWED=NO
# ── test ────────────────────────────────────────────────────────────────── # ── test ──────────────────────────────────────────────────────────────────
test: test:
@@ -65,30 +41,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install just
run: brew install just
- name: Install xcodegen - name: Install xcodegen
run: brew install xcodegen run: brew install xcodegen
- name: Generate Xcode project
run: xcodegen generate --spec project.yml --project .
- name: Resolve SPM packages
run: |
xcodebuild \
-project LibNovel.xcodeproj \
-scheme LibNovel \
-resolvePackageDependencies \
-clonedSourcePackagesDirPath .spm-cache
- name: Run unit tests - name: Run unit tests
run: | run: just ios-test
xcodebuild test \
-project LibNovel.xcodeproj \
-scheme LibNovel \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 17' \
-clonedSourcePackagesDirPath .spm-cache \
CODE_SIGNING_ALLOWED=NO \
| xcpretty --report junit --output test-results.xml || true
- name: Upload test results - name: Upload test results
if: always() if: always()
@@ -102,6 +62,7 @@ jobs:
# Runs only on pushes to v2/main (not PRs). # Runs only on pushes to v2/main (not PRs).
# Requires secrets: APPLE_CERTIFICATE_BASE64, APPLE_CERTIFICATE_PASSWORD, # Requires secrets: APPLE_CERTIFICATE_BASE64, APPLE_CERTIFICATE_PASSWORD,
# APPLE_PROVISIONING_PROFILE_BASE64, KEYCHAIN_PASSWORD # APPLE_PROVISIONING_PROFILE_BASE64, KEYCHAIN_PASSWORD
# Also requires ios/LibNovel/ExportOptions.plist to exist.
# #
# archive: # archive:
# name: Archive # name: Archive
@@ -112,13 +73,12 @@ jobs:
# steps: # steps:
# - uses: actions/checkout@v4 # - uses: actions/checkout@v4
# #
# - name: Install just
# run: brew install just
#
# - name: Install xcodegen # - name: Install xcodegen
# run: brew install xcodegen # run: brew install xcodegen
# #
# - name: Generate Xcode project
# run: xcodegen generate --spec project.yml --project .
# working-directory: ios/LibNovel
#
# - name: Import signing certificate # - name: Import signing certificate
# env: # env:
# CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }} # CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
@@ -145,25 +105,5 @@ jobs:
# mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles # mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
# cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/ # cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/
# #
# - name: Archive # - name: Archive & export IPA
# run: | # run: just ios-archive && just ios-export
# xcodebuild archive \
# -project LibNovel.xcodeproj \
# -scheme LibNovel \
# -configuration Release \
# -archivePath $RUNNER_TEMP/LibNovel.xcarchive
# working-directory: ios/LibNovel
#
# - name: Export IPA
# run: |
# xcodebuild -exportArchive \
# -archivePath $RUNNER_TEMP/LibNovel.xcarchive \
# -exportPath $RUNNER_TEMP/ipa \
# -exportOptionsPlist ios/ExportOptions.plist
#
# - name: Upload IPA artifact
# uses: actions/upload-artifact@v4
# with:
# name: LibNovel-release
# path: ${{ runner.temp }}/ipa/LibNovel.ipa
# retention-days: 30

View File

@@ -1,9 +1,13 @@
# justfile — libnovel-v2 task runner # justfile — libnovel-v2 task runner
# Install just: https://just.systems # Install just: https://just.systems
scraper_dir := "scraper" scraper_dir := "scraper"
ui_dir := "ui" ui_dir := "ui"
ios_dir := "ios/LibNovel" ios_dir := "ios/LibNovel"
ios_scheme := "LibNovel"
ios_sim := "platform=iOS Simulator,name=iPhone 17"
ios_spm := ".spm-cache"
runner_temp := env_var_or_default("RUNNER_TEMP", "/tmp")
# ─── Build ──────────────────────────────────────────────────────────────────── # ─── Build ────────────────────────────────────────────────────────────────────
@@ -19,7 +23,7 @@ build-all:
# Run unit tests only (no integration services required) # Run unit tests only (no integration services required)
test: test:
cd {{scraper_dir}} && go test ./... cd {{scraper_dir}} && go test -race -count=1 -timeout=60s ./...
# Run integration tests (requires MinIO, PocketBase, optional Browserless) # Run integration tests (requires MinIO, PocketBase, optional Browserless)
# Override env vars as needed, e.g.: # Override env vars as needed, e.g.:
@@ -85,23 +89,63 @@ ui-build:
ios-gen: ios-gen:
cd {{ios_dir}} && xcodegen generate --spec project.yml --project . cd {{ios_dir}} && xcodegen generate --spec project.yml --project .
# Build the iOS app for the simulator (no signing required) # Resolve SPM package dependencies (cached to {{ios_spm}})
ios-build: ios-gen ios-resolve:
cd {{ios_dir}} && xcodebuild \ cd {{ios_dir}} && xcodebuild \
-project LibNovel.xcodeproj \ -project {{ios_scheme}}.xcodeproj \
-scheme LibNovel \ -scheme {{ios_scheme}} \
-resolvePackageDependencies \
-clonedSourcePackagesDirPath {{ios_spm}}
# Build the iOS app for the simulator (no signing required)
# Runs ios-gen first to ensure the project is up to date.
ios-build: ios-gen ios-resolve
cd {{ios_dir}} && set -o pipefail && xcodebuild \
-project {{ios_scheme}}.xcodeproj \
-scheme {{ios_scheme}} \
-configuration Debug \ -configuration Debug \
-destination 'generic/platform=iOS Simulator' \ -destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO -clonedSourcePackagesDirPath {{ios_spm}} \
CODE_SIGNING_ALLOWED=NO \
| xcpretty || xcodebuild \
-project {{ios_scheme}}.xcodeproj \
-scheme {{ios_scheme}} \
-configuration Debug \
-destination 'generic/platform=iOS Simulator' \
-clonedSourcePackagesDirPath {{ios_spm}} \
CODE_SIGNING_ALLOWED=NO
# Run unit tests on the simulator # Run unit tests on the simulator
ios-test: ios-gen # Runs ios-gen first to ensure the project is up to date.
cd {{ios_dir}} && xcodebuild test \ ios-test: ios-gen ios-resolve
-project LibNovel.xcodeproj \ cd {{ios_dir}} && set -o pipefail && xcodebuild test \
-scheme LibNovel \ -project {{ios_scheme}}.xcodeproj \
-scheme {{ios_scheme}} \
-configuration Debug \ -configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 17' \ -destination '{{ios_sim}}' \
CODE_SIGNING_ALLOWED=NO -clonedSourcePackagesDirPath {{ios_spm}} \
CODE_SIGNING_ALLOWED=NO \
| xcpretty --report junit --output test-results.xml || true
# Archive a signed Release build (requires valid signing identity in keychain).
# Output: {{runner_temp}}/LibNovel.xcarchive
# Typically called from CI after importing certificate + provisioning profile.
ios-archive: ios-gen ios-resolve
cd {{ios_dir}} && xcodebuild archive \
-project {{ios_scheme}}.xcodeproj \
-scheme {{ios_scheme}} \
-configuration Release \
-clonedSourcePackagesDirPath {{ios_spm}} \
-archivePath {{runner_temp}}/LibNovel.xcarchive
# Export an IPA from the archive produced by ios-archive.
# Requires ios/LibNovel/ExportOptions.plist.
# Output: {{runner_temp}}/ipa/LibNovel.ipa
ios-export:
cd {{ios_dir}} && xcodebuild -exportArchive \
-archivePath {{runner_temp}}/LibNovel.xcarchive \
-exportPath {{runner_temp}}/ipa \
-exportOptionsPlist ExportOptions.plist
# ─── Docker Compose ─────────────────────────────────────────────────────────── # ─── Docker Compose ───────────────────────────────────────────────────────────