Add CANFD support to Linux CAN #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dart | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup flutter SDK | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
- name: Setup melos | |
run: dart pub global activate melos | |
- run: flutter doctor -v | |
- run: flutter precache | |
- name: melos bootstrap | |
run: dart pub global run melos bootstrap | |
- name: melos checkformat | |
run: dart pub global run melos run checkformat | |
- name: melos analyze | |
run: dart pub global run melos run analyze | |
- name: melos test | |
run: dart pub global run melos test | |
create-panda-temp-key: | |
name: Create temporary SSH key | |
runs-on: panda | |
concurrency: panda-temp-key | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate keypair | |
run: | | |
ssh-keygen -b 4096 -t rsa -f ./sshkey -q -N "" | |
- name: Add public key to authorized_keys | |
run: | | |
echo expiry-time='"'$(date --date=+1hour +%Y%m%d%H%M)'"' $(cat ./sshkey.pub) > ~/.ssh/authorized_keys | |
- name: Encrypt private key for uploading | |
env: | |
AES_KEY: ${{ secrets.AES_KEY }} | |
run: | | |
gpg \ | |
--batch --yes \ | |
--symmetric --cipher-algo AES256 \ | |
--passphrase="$AES_KEY" \ | |
--output ./sshkey.gpg \ | |
sshkey | |
- name: Upload keypair | |
uses: actions/upload-artifact@v3 | |
with: | |
name: keypair | |
path: | | |
sshkey.gpg | |
sshkey.pub | |
integration-test: | |
runs-on: ubuntu-latest | |
needs: create-panda-temp-key | |
concurrency: panda-temp-key | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download keypair | |
uses: actions/download-artifact@v3 | |
with: | |
name: keypair | |
path: . | |
- name: Decrypt private key | |
env: | |
AES_KEY: ${{ secrets.AES_KEY }} | |
run: | | |
gpg \ | |
--batch --yes \ | |
--decrypt \ | |
--passphrase="$AES_KEY" \ | |
--output ./sshkey \ | |
./sshkey.gpg | |
chmod 0600 ./sshkey | |
- name: Setup adb forward | |
run: | | |
mkdir -p ~/.ssh | |
echo "[md.ardera.dev]:23 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBC41DBiTm+uvaeZqUp4LcUck99c7+vIv/nS4rH4rt/rmSs5KAlJrz7TwicgDYobAdDL8Nnfyz0F2CG88uCNRea0=" >> ~/.ssh/known_hosts | |
ssh -vvv -N -n -o ExitOnForwardFailure=yes -o BatchMode=yes -L 127.0.0.1:5555:odroid-c4:5555 -p 23 -i ./sshkey [email protected] & | |
sleep 5 | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: List adb devices | |
run: | | |
adb devices -l | |
adb connect 127.0.0.1:5555 | |
adb devices -l | |
- name: Setup flutter SDK | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
- name: Setup melos | |
run: dart pub global activate melos | |
- run: flutter doctor -v | |
- run: flutter precache | |
- name: melos bootstrap | |
run: dart pub global run melos bootstrap | |
- name: make ODROID C4 gpio chips accessible | |
run: | | |
adb -t 2 shell chmod 0777 /dev/gpiochip0 | |
adb -t 2 shell chmod 0777 /dev/gpiochip1 | |
- name: run flutter_gpiod_test_app on ODROID C4 | |
working-directory: packages/flutter_gpiod_test_app | |
run: flutter test -d "127.0.0.1:5555" -t odroidc4 integration_test/gpio_test.dart | |
delete-panda-temp-key: | |
name: Delete temporary SSH key | |
runs-on: panda | |
needs: integration-test | |
concurrency: panda-temp-key | |
# run even if integration-test failed | |
if: ${{ always() }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download keypair | |
uses: actions/download-artifact@v3 | |
with: | |
name: keypair | |
path: . | |
- name: Remove key from authorized_keys file | |
run: | | |
echo "::group::List authorized keys" | |
echo "::debug::$(cat ~/.ssh/authorized_keys)" | |
echo "::endgroup::" | |
grep -v "$(cat sshkey.pub)" ~/.ssh/authorized_keys | sponge ~/.ssh/authorized_keys | |
echo "::group::List authorized keys" | |
echo "::debug::$(cat ~/.ssh/authorized_keys)" | |
echo "::endgroup::" |