Skip to content

Commit 7d47a56

Browse files
authored
Refactor to allow building releases (#445)
* Update libraries and lint. * WIP: try simple build script * WIP: Attempt to build and release * WIP: refactor workflows and directories. * WIP: Update scripts. * WIP: fix some lint issues. * WIP: Debugging to understand failing `dart analyze`. * WIP: do `dart pub get` before `dart analyze`. * WIP: Don't queue 'release' job if not on a tag. * WIP: see if we can find the artifacts. * WIP: See if this creates and finds the file to archive. * Try building log_file_client. * Try building log file server. * Do `dart pub get` before `dart compile exe`. * Start a background log_file_server before tests. * Allow `rootDir` to be configurable from the command line so tests are not in a protected directory. * Provide path to executable as well as log directory. * Create log files needed for tests. * Changes to file creation to remove an extra newline. * Update version. * Test device_controller on every push. --------- Co-authored-by: James Foster <[email protected]>
1 parent 53e5023 commit 7d47a56

File tree

125 files changed

+1211
-1661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1211
-1661
lines changed

.github/workflows/Arduino-CI.yaml

-21
This file was deleted.

.github/workflows/buildWeb.yml

-21
This file was deleted.

.github/workflows/check-spelling.yml

-26
This file was deleted.

.github/workflows/device-client.yaml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: Build, test, and release device_client
3+
on: push
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: checkout code
9+
uses: actions/checkout@v4
10+
- name: install flutter
11+
uses: subosito/flutter-action@v2
12+
with:
13+
flutter-version: '3.19.3'
14+
channel: 'stable'
15+
- name: use cache
16+
uses: actions/cache@v3
17+
with:
18+
path: /home/runner/.pub-cache
19+
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
20+
restore-keys: |
21+
${{ runner.os }}-pub-cache-
22+
- name: build web application
23+
run: |
24+
cd extras/device_client
25+
flutter --version >> /dev/null # avoid welcome message
26+
flutter build web
27+
tar -czvf /tmp/device_client.tar.gz build/web
28+
- name: save web files as an artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: device_client
32+
path: /tmp/device_client.tar.gz
33+
retention-days: 1
34+
35+
test:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
steps:
39+
- name: checkout code
40+
uses: actions/checkout@v4
41+
- name: install flutter
42+
uses: subosito/flutter-action@v2
43+
with:
44+
flutter-version: '3.19.3'
45+
channel: 'stable'
46+
- name: use cache
47+
uses: actions/cache@v3
48+
with:
49+
path: /home/runner/.pub-cache
50+
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
51+
restore-keys: |
52+
${{ runner.os }}-pub-cache-
53+
- name: lint and test
54+
run: |
55+
cd extras/device_client
56+
dart pub get # https://github.com/dart-lang/sdk/issues/50422
57+
dart format --output=none --set-exit-if-changed .
58+
dart analyze --fatal-infos
59+
flutter --version >> /dev/null # avoid welcome message
60+
flutter test --concurrency=1
61+
62+
release:
63+
if: startsWith(github.ref, 'refs/tags/v')
64+
runs-on: ubuntu-latest
65+
needs: test
66+
steps:
67+
- name: download web files
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: device_client
71+
- name: create release
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
files: device_client.tar.gz
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Build, test, and release device_controller
3+
on: push
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: arduino/arduino-lint-action@v1
10+
with:
11+
library-manager: update
12+
compliance: strict
13+
spelling:
14+
name: Check Spelling
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
with:
20+
# Full git history is needed to get a proper list of changed files within `super-linter`
21+
fetch-depth: 0
22+
- name: Check Spelling
23+
uses: codespell-project/actions-codespell@master
24+
with:
25+
check_filenames: true
26+
arduino_ci:
27+
runs-on: ubuntu-latest
28+
needs: [lint, spelling]
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: ruby/setup-ruby@v1
32+
with:
33+
ruby-version: 3.3
34+
- name: Run Arduino-CI Tests
35+
run: |
36+
extras/scripts/install_libraries.sh
37+
extras/scripts/testAndBuild.sh

.github/workflows/flutterLint.yaml

-28
This file was deleted.

.github/workflows/flutterTests.yml

-11
This file was deleted.

.github/workflows/format.yaml

-15
This file was deleted.

.github/workflows/lint.yaml

-12
This file was deleted.
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: Build, test, and release log_file_client
3+
on: push
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: checkout code
9+
uses: actions/checkout@v4
10+
- name: install flutter
11+
uses: subosito/flutter-action@v2
12+
with:
13+
flutter-version: '3.19.3'
14+
channel: 'stable'
15+
- name: use cache
16+
uses: actions/cache@v3
17+
with:
18+
path: /home/runner/.pub-cache
19+
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
20+
restore-keys: |
21+
${{ runner.os }}-pub-cache-
22+
- name: build web application
23+
run: |
24+
cd extras/log_file_client
25+
flutter --version >> /dev/null # avoid welcome message
26+
flutter build web
27+
tar -czvf /tmp/log_file_client.tar.gz build/web
28+
- name: save web files as an artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: log_file_client
32+
path: /tmp/log_file_client.tar.gz
33+
retention-days: 1
34+
35+
test:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
steps:
39+
- name: checkout code
40+
uses: actions/checkout@v4
41+
- name: install flutter
42+
uses: subosito/flutter-action@v2
43+
with:
44+
flutter-version: '3.19.3'
45+
channel: 'stable'
46+
- name: use cache
47+
uses: actions/cache@v3
48+
with:
49+
path: /home/runner/.pub-cache
50+
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
51+
restore-keys: |
52+
${{ runner.os }}-pub-cache-
53+
- name: lint and test
54+
run: |
55+
cd extras/log_file_client
56+
dart pub get # https://github.com/dart-lang/sdk/issues/50422
57+
dart format --output=none --set-exit-if-changed .
58+
dart analyze --fatal-infos
59+
flutter --version >> /dev/null # avoid welcome message
60+
flutter test --concurrency=1
61+
62+
release:
63+
if: startsWith(github.ref, 'refs/tags/v')
64+
runs-on: ubuntu-latest
65+
needs: test
66+
steps:
67+
- name: download web files
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: log_file_client
71+
- name: create release
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
files: log_file_client.tar.gz

0 commit comments

Comments
 (0)