From 0490378ecb9de4738952cfd2f4c974788f5180cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthew=20J=C3=B6rke?= Date: Tue, 7 Oct 2025 12:59:37 -0700 Subject: [PATCH 1/4] add workflow files --- .github/workflows/ios.yml | 45 ++++++++++++++ .github/workflows/python-lint-typecheck.yml | 59 ++++++++++++++++++ .github/workflows/ts-lint-typecheck.yml | 67 +++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 .github/workflows/ios.yml create mode 100644 .github/workflows/python-lint-typecheck.yml create mode 100644 .github/workflows/ts-lint-typecheck.yml diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml new file mode 100644 index 0000000..350c9cb --- /dev/null +++ b/.github/workflows/ios.yml @@ -0,0 +1,45 @@ +# +# This source file is part of the Stanford Bloom Application based on the Stanford Spezi Template Application project +# +# SPDX-FileCopyrightText: 2025 Stanford University and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: iOS + +on: + push: + branches: + - main + paths: + - "ios/**" # Only trigger on file changes in "ios" directory + pull_request: + paths: + - "ios/**" # Only trigger on file changes in "ios" directory + workflow_dispatch: + workflow_call: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + swiftlint: + name: SwiftLint + uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2 + permissions: + contents: read + with: + path: ios + buildandtest: + name: Build and Test + uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2 + permissions: + contents: read + with: + runsonlabels: '["self-hosted","macOS","ARM64"]' + setupfirebaseemulator: true + resultBundle: Bloom.xcresult + artifactname: Bloom.xcresult + customcommand: "corepack enable && yarn install && { yarn start > server.log 2>&1 & } && cd ios && pod install && fastlane build" diff --git a/.github/workflows/python-lint-typecheck.yml b/.github/workflows/python-lint-typecheck.yml new file mode 100644 index 0000000..9d0f50f --- /dev/null +++ b/.github/workflows/python-lint-typecheck.yml @@ -0,0 +1,59 @@ +name: Python Lint & Type Check + +on: + push: + branches: + - main + paths: + - 'backend/**/*.py' # Only trigger on Python file changes in backend + pull_request: + paths: + - 'backend/**/*.py' # Only trigger on Python file changes in backend + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ruff + + - name: Run Ruff in backend + run: ruff check backend + + mypy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install mypy + pip install -r backend/requirements.txt + + - name: Install missing types for mypy + run: | + mypy --install-types --non-interactive backend + + - name: Run mypy in backend + run: mypy backend + diff --git a/.github/workflows/ts-lint-typecheck.yml b/.github/workflows/ts-lint-typecheck.yml new file mode 100644 index 0000000..3a73e8b --- /dev/null +++ b/.github/workflows/ts-lint-typecheck.yml @@ -0,0 +1,67 @@ +name: Typescript Lint & Type Check + +on: + push: + branches: + - main + paths: + - 'frontend/**/*.ts' + - 'frontend/**/*.tsx' + - 'index.tsx' + pull_request: + paths: + - 'frontend/**/*.ts' + - 'frontend/**/*.tsx' + - 'index.tsx' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' # Or whichever version you're using + + - name: Enable Corepack and prepare Yarn + run: | + corepack enable + corepack prepare yarn@3.6.4 --activate + + - name: Install dependencies + run: | + yarn install + + - name: Run ESLint in frontend and root + run: | + npx eslint frontend/**/*.ts frontend/**/*.tsx index.tsx + + tsc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' # Or whichever version you're using + + - name: Enable Corepack and prepare Yarn + run: | + corepack enable + corepack prepare yarn@3.6.4 --activate + + - name: Install dependencies + run: | + yarn install + + - name: Run TypeScript compiler to check types + run: | + npx tsc --noEmit From cc1a0df883dedd1a1ec2bf432eeb8f83cc7c05b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthew=20J=C3=B6rke?= Date: Tue, 7 Oct 2025 13:05:07 -0700 Subject: [PATCH 2/4] force workflow trigger by commenting path filters --- .github/workflows/ios.yml | 4 ++-- .github/workflows/python-lint-typecheck.yml | 4 ++-- .github/workflows/ts-lint-typecheck.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 350c9cb..42775ca 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -15,8 +15,8 @@ on: paths: - "ios/**" # Only trigger on file changes in "ios" directory pull_request: - paths: - - "ios/**" # Only trigger on file changes in "ios" directory + # paths: + # - "ios/**" # Only trigger on file changes in "ios" directory workflow_dispatch: workflow_call: diff --git a/.github/workflows/python-lint-typecheck.yml b/.github/workflows/python-lint-typecheck.yml index 9d0f50f..9fedec1 100644 --- a/.github/workflows/python-lint-typecheck.yml +++ b/.github/workflows/python-lint-typecheck.yml @@ -7,8 +7,8 @@ on: paths: - 'backend/**/*.py' # Only trigger on Python file changes in backend pull_request: - paths: - - 'backend/**/*.py' # Only trigger on Python file changes in backend + # paths: + # - 'backend/**/*.py' # Only trigger on Python file changes in backend workflow_dispatch: concurrency: diff --git a/.github/workflows/ts-lint-typecheck.yml b/.github/workflows/ts-lint-typecheck.yml index 3a73e8b..f192837 100644 --- a/.github/workflows/ts-lint-typecheck.yml +++ b/.github/workflows/ts-lint-typecheck.yml @@ -9,10 +9,10 @@ on: - 'frontend/**/*.tsx' - 'index.tsx' pull_request: - paths: - - 'frontend/**/*.ts' - - 'frontend/**/*.tsx' - - 'index.tsx' + # paths: + # - 'frontend/**/*.ts' + # - 'frontend/**/*.tsx' + # - 'index.tsx' workflow_dispatch: concurrency: From 038c67dd6e68090d42364a1904add0851db3e338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthew=20J=C3=B6rke?= Date: Tue, 7 Oct 2025 13:14:16 -0700 Subject: [PATCH 3/4] removing self-hosted label for xcodebuild workflow --- .github/workflows/ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 42775ca..5329864 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -38,7 +38,7 @@ jobs: permissions: contents: read with: - runsonlabels: '["self-hosted","macOS","ARM64"]' + # runsonlabels: '["self-hosted","macOS","ARM64"]' setupfirebaseemulator: true resultBundle: Bloom.xcresult artifactname: Bloom.xcresult From f6c6276eb68b098677f2b06baa78c5250f3910b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthew=20J=C3=B6rke?= Date: Tue, 7 Oct 2025 15:19:50 -0700 Subject: [PATCH 4/4] revert path-dependent triggers --- .github/workflows/ios.yml | 5 ++--- .github/workflows/python-lint-typecheck.yml | 4 ++-- .github/workflows/ts-lint-typecheck.yml | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 5329864..9efe2e1 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -15,8 +15,8 @@ on: paths: - "ios/**" # Only trigger on file changes in "ios" directory pull_request: - # paths: - # - "ios/**" # Only trigger on file changes in "ios" directory + paths: + - "ios/**" # Only trigger on file changes in "ios" directory workflow_dispatch: workflow_call: @@ -38,7 +38,6 @@ jobs: permissions: contents: read with: - # runsonlabels: '["self-hosted","macOS","ARM64"]' setupfirebaseemulator: true resultBundle: Bloom.xcresult artifactname: Bloom.xcresult diff --git a/.github/workflows/python-lint-typecheck.yml b/.github/workflows/python-lint-typecheck.yml index 9fedec1..9d0f50f 100644 --- a/.github/workflows/python-lint-typecheck.yml +++ b/.github/workflows/python-lint-typecheck.yml @@ -7,8 +7,8 @@ on: paths: - 'backend/**/*.py' # Only trigger on Python file changes in backend pull_request: - # paths: - # - 'backend/**/*.py' # Only trigger on Python file changes in backend + paths: + - 'backend/**/*.py' # Only trigger on Python file changes in backend workflow_dispatch: concurrency: diff --git a/.github/workflows/ts-lint-typecheck.yml b/.github/workflows/ts-lint-typecheck.yml index f192837..3a73e8b 100644 --- a/.github/workflows/ts-lint-typecheck.yml +++ b/.github/workflows/ts-lint-typecheck.yml @@ -9,10 +9,10 @@ on: - 'frontend/**/*.tsx' - 'index.tsx' pull_request: - # paths: - # - 'frontend/**/*.ts' - # - 'frontend/**/*.tsx' - # - 'index.tsx' + paths: + - 'frontend/**/*.ts' + - 'frontend/**/*.tsx' + - 'index.tsx' workflow_dispatch: concurrency: