Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 13 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
name: build
name: Build & Test

on:
push:
branches:
- main
branches: [ main, dev ]
pull_request:
branches:
- main
branches: [ main, dev ]

jobs:
build:
runs-on: macos-12
runs-on: macos-latest # or macos-15 if you want to pin the image

env:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app
DEVELOPER_DIR: /Applications/Xcode_26.app/Contents/Developer

steps:
- uses: actions/checkout@v2

- name: Build
run: swift build -v

- name: Run tests
run: swift test -v
- uses: actions/checkout@v4

lint:
runs-on: ubuntu-latest
- name: Select Xcode 26
run: sudo xcode-select -s "$DEVELOPER_DIR"

steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v

- uses: norio-nomura/action-swiftlint@3.2.1
- name: Run tests
run: swift test --enable-swift-testing -v
89 changes: 89 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "CodeQL + Docs + AI review"

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
schedule:
- cron: '39 19 * * 1' # weekly scan

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}

permissions:
security-events: write
packages: read
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
# Your Swift package
- language: swift
build-mode: manual

# Actions workflow YAML
- language: actions
build-mode: none

# Optional: Ruby (for Gemfile / Jazzy tooling)
- language: ruby
build-mode: none

steps:
- name: Checkout repository
uses: actions/checkout@v4

# ---------- Swift docs (runs only once, on Swift job) ----------
- name: Generate Swift docs (swift-doc)
if: matrix.language == 'swift'
uses: SwiftDocOrg/swift-doc@1.0.0-rc.1
with:
# Adjust if your package name or module differ
package: .
format: html
output: docs-swiftdoc

# ---------- Claude Code (AI review) ----------
# Requires ANTHROPIC_API_KEY secret if you enable it.
- name: Claude Code Action Official
if: matrix.language == 'swift'
uses: anthropics/claude-code-action@v1
with:
# Example minimal config; adjust as you refine prompts:
github_token: ${{ secrets.GITHUB_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# mode: "pr_review" # uncomment if you want it only on PRs

# ---------- Initialize CodeQL ----------
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

# ---------- Manual Swift build for CodeQL ----------
- name: Build Swift package (SPM)
if: matrix.language == 'swift' && matrix.build-mode == 'manual'
shell: bash
run: |
swift --version
swift build -v

# ---------- Default manual step for other languages (kept as no-op) ----------
- name: Run manual build steps (non-swift)
if: matrix.language != 'swift' && matrix.build-mode == 'manual'
shell: bash
run: |
echo "No manual build required for ${LANGUAGE}"

# ---------- Run analysis ----------
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docs

on:
push:
branches:
- dev
paths:
- 'Package.swift'
- '.jazzy.yaml'
- 'Sources/**'
workflow_dispatch:

jobs:
generate-docs:
runs-on: macos-15

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

- name: Generate docs
run: Scripts/generate_docs.sh

# Optional: commit docs back to dev
- name: Commit docs
if: github.ref == 'refs/heads/dev'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs
git commit -m "Update docs" || echo "No changes"
git push
57 changes: 29 additions & 28 deletions .github/workflows/generate-doc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: generate-doc
name: Generate Jazzy Docs

on:
release:
Expand All @@ -10,57 +10,58 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: master

- name: Get tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
run: echo "tag=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
working-directory: master

- name: Setup ruby
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
ruby-version: '3.2'
bundler-cache: true
working-directory: master

- name: Build doc
- name: Build docs with Jazzy
env:
RELEASE_VERSION: ${{steps.vars.outputs.tag}}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
bundle install
bundle exec jazzy --clean --output .build/jazzy --author 'Outblock Team' --author_url https://github.com/outblock/flow-swift --github_url https://github.com/outblock/flow-swift --github-file-prefix https://github.com/outblock/flow-swift/tree/${RELEASE_VERSION} --module-version ${RELEASE_VERSION} --exclude 'Sources/Flow/Protobuf/*'
bundle exec jazzy \
--clean \
--output .build/jazzy \
--author 'Outblock Team' \
--author_url https://github.com/outblock/flow-swift \
--github_url https://github.com/outblock/flow-swift \
--github-file-prefix https://github.com/outblock/flow-swift/tree/${RELEASE_VERSION} \
--module-version ${RELEASE_VERSION} \
--exclude 'Sources/Flow/Protobuf/*'
working-directory: master
- name: Checkout doc
uses: actions/checkout@v2

- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages

- name: Clean old doc
run: rm -rf docs/current
working-directory: gh-pages

- name: Copy new doc
- name: Update docs
env:
G_WORKSPACE: ${{github.workspace}}
RELEASE_VERSION: ${{steps.vars.outputs.tag}}
G_WORKSPACE: ${{ github.workspace }}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
cd gh-pages
rm -rf docs/current
mkdir -p docs/current
mkdir -p docs/$RELEASE_VERSION
cp -R ${G_WORKSPACE}/master/.build/jazzy/* docs/current
cp -R ${G_WORKSPACE}/master/.build/jazzy/* docs/$RELEASE_VERSION
working-directory: gh-pages
cp -R "${G_WORKSPACE}/master/.build/jazzy/"* docs/current
cp -R "${G_WORKSPACE}/master/.build/jazzy/"* docs/$RELEASE_VERSION

- name: Commit
env:
RELEASE_VERSION: ${{steps.vars.outputs.tag}}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "generate ${RELEASE_VERSION} docs automatically"
git add docs
git commit -m "Generate ${RELEASE_VERSION} docs automatically" || echo "No changes"
git push
working-directory: gh-pages
4 changes: 4 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
swift_build_tool: spm
module: Flow
min_acl: public
output: docs
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

gem "jazzy"
gem "jazzy"
88 changes: 66 additions & 22 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading