Skip to content

Commit 0173e2a

Browse files
committed
ci: Add Celest CLI workflow
1 parent e3da0c3 commit 0173e2a

File tree

5 files changed

+94
-9
lines changed

5 files changed

+94
-9
lines changed

.github/workflows/celest_cli.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: celest_cli
2+
on:
3+
pull_request:
4+
paths:
5+
- ".github/workflows/apps_cli.yaml"
6+
- "apps/cli/**"
7+
- "packages/**"
8+
- "services/**"
9+
10+
# Prevent duplicate runs due to Graphite
11+
# https://graphite.dev/docs/troubleshooting#why-are-my-actions-running-twice
12+
concurrency:
13+
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}}
14+
cancel-in-progress: true
15+
16+
env:
17+
CELEST_LOCAL_PATH: ${{ github.workspace }}
18+
19+
jobs:
20+
test:
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os:
25+
- ubuntu-latest
26+
- macos-14
27+
- windows-latest
28+
runs-on: ${{ matrix.os }}
29+
# TODO(dnys1): Remove when CLI tests are faster (Golang wrapper + native assets removal)
30+
timeout-minutes: 45
31+
steps:
32+
- name: Git Checkout
33+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
34+
with:
35+
submodules: recursive
36+
# Needed for flutter-version-file: https://github.com/subosito/flutter-action?tab=readme-ov-file#use-version-from-pubspecyaml
37+
- name: Install yq
38+
if: runner.os == 'Windows'
39+
shell: bash
40+
run: |
41+
curl -sL "https://github.com/mikefarah/yq/releases/download/v4.43.1/yq_windows_amd64.exe" -o yq.exe
42+
echo "$PWD" >> "$GITHUB_PATH"
43+
- name: Setup Flutter
44+
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
45+
with:
46+
cache: true
47+
# Locks version to repo constraint (for golden test alignment)
48+
flutter-version-file: pubspec.yaml
49+
- name: Setup Libsecret
50+
if: runner.os == 'Linux'
51+
run: tool/setup-ci.sh
52+
- name: Get Packages
53+
working-directory: apps/cli
54+
run: dart pub upgrade
55+
- name: Test
56+
working-directory: apps/cli
57+
run: dart test -x e2e --fail-fast
58+
# - name: Test (Fixtures)
59+
# working-directory: apps/cli
60+
# run: dart test fixtures/legacy/fixtures_test.dart --fail-fast -j 1

apps/cli/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ dependency_overrides:
8888
# TODO: Remove when built_value supports latest analyzer
8989
analyzer: ^7.3.0
9090
celest:
91-
path: ../../celest/packages/celest
91+
path: ../../packages/celest
9292
celest_ast:
93-
path: ../../celest/packages/celest_ast
93+
path: ../../packages/celest_ast
9494
celest_auth:
95-
path: ../../celest/packages/celest_auth
95+
path: ../../packages/celest_auth
9696
celest_cloud:
97-
path: ../../celest/packages/celest_cloud
97+
path: ../../packages/celest_cloud
9898
celest_core:
99-
path: ../../celest/packages/celest_core
99+
path: ../../packages/celest_core
100100
# TODO: Remove when built_value supports latest analyzer
101101
source_gen: ^2.0.0
102102

apps/cli/test/analyzer/celest_analyzer_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ Future<CelestProject> newProject({
4242
projectDart += authDart;
4343
}
4444
final celestDir = p.fromUri(
45-
Directory.current.uri.resolve('../../celest/packages/celest/'),
45+
Directory.current.uri.resolve('../../packages/celest/'),
4646
);
4747
final celestCoreDir = p.fromUri(
48-
Directory.current.uri.resolve('../../celest/packages/celest_core/'),
48+
Directory.current.uri.resolve('../../packages/celest_core/'),
4949
);
5050
final packageConfig = PackageConfig([
5151
Package(

pubspec.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: celest_dev
22
publish_to: none
33

4+
# The version locks for GitHub actions.
5+
#
6+
# Because many golden tests encode the precise Dart/Flutter SDKs used to generate
7+
# them, these values must be consistently used when running tests locally and in CI.
8+
#
9+
# However, setting these locks in the actual packages is too restrictive when
10+
# switching between versions, so they are instead centrally managed here.
411
environment:
5-
sdk: ^3.4.0
6-
flutter: ">=3.22.0"
12+
sdk: 3.7.0
13+
flutter: 3.29.0
714

815
dev_dependencies:
916
melos: ^5.3.0

tool/setup-ci.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
6+
7+
sudo apt-get update && sudo apt-get install -y libsecret-1-dev gnome-keyring jq
8+
9+
# If running in headless mode, re-run script in dbus session.
10+
if [ -z $DBUS_SESSION_BUS_ADDRESS && -n $1 ]; then
11+
exec dbus-run-session -- $@
12+
fi
13+
14+
# Set up keyring in CI env
15+
if [ -n $CI ]; then
16+
echo 'password' | gnome-keyring-daemon --start --replace --daemonize --unlock
17+
fi
18+
fi

0 commit comments

Comments
 (0)