Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ditch-arduino-serial
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Nov 14, 2024
2 parents 7745c8e + 611343b commit 5379918
Show file tree
Hide file tree
Showing 135 changed files with 6,854 additions and 6,838 deletions.
34 changes: 29 additions & 5 deletions .github/actions/build-frontend/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: build-frontend
description: Builds the frontend and uploads it as an artifact
inputs:
pnpm-version:
description: 'pnpm version to use'
required: true
node-version:
description: 'NodeJS runtime version to use'
required: true
Expand All @@ -18,21 +21,42 @@ runs:
frontend
path: ${{ github.repository }}

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ inputs.pnpm-version }}
run_install: false

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
cache-dependency-path: ./frontend/package-lock.json
node-version-file: ./frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: ./frontend/pnpm-lock.yaml

- name: Install dependencies
working-directory: ./frontend
shell: bash
run: npm ci
run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Check
working-directory: ./frontend
shell: bash
run: pnpm run check

- name: Install playwright
working-directory: ./frontend
shell: bash
run: pnpx playwright install --with-deps

- name: Test
working-directory: ./frontend
shell: bash
run: pnpm test

- name: Build
working-directory: ./frontend
shell: bash
run: npm run build
run: pnpm run build

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
25 changes: 22 additions & 3 deletions .github/actions/cdn-bump-version/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
name: cdn-bump-version
description: Uploads version file to CDN
inputs:
cf-bucket:
description: Name of the S3 bucket
bunny-stor-hostname:
description: Bunny SFTP Hostname
required: true
bunny-stor-username:
description: Bunny SFTP Username
required: true
bunny-stor-password:
description: Bunny SFTP Password
required: true
bunny-api-key:
description: Bunny API key
required: true
bunny-cdn-url:
description: Bunny pull zone base url e.g. https://firmware.openshock.org (no trailing slash)
required: true
version:
description: 'Version of the release'
Expand All @@ -19,4 +31,11 @@ runs:
run: |
mkdir -p upload
echo "${{ inputs.version }}" >> upload/version-${{ inputs.release-channel }}.txt
rclone copy upload cdn:${{ inputs.cf-bucket }}/
sshpass -p "${{ inputs.bunny-stor-password }}" scp -v -r upload/* ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/
- name: Purge CDN cache
shell: bash
run: |
curl -X POST "https://api.bunny.net/purge?url=${{ inputs.bunny-cdn-url }}/version-${{ inputs.release-channel }}.txt" \
-H "Content-Type: application/json" \
-H "AccessKey: ${{ inputs.bunny-api-key }}"
29 changes: 8 additions & 21 deletions .github/actions/cdn-prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
name: cdn-prepare
description: Prepares the CDN for firmware uploads
description: Bunny sshpass and knowhosts setup
inputs:
cf-account-id:
description: Cloudflare Account ID
required: true
cf-access-key-id:
description: Cloudflare Access Key ID
required: true
cf-secret-access-key:
description: Cloudflare Secret Access Key
bunny-ssh-knownhosts:
description: Bunny SFTP Hostname
required: true

runs:
using: composite
steps:
- name: Install rclone
- name: Install sshpass
shell: bash
run: sudo apt-get install -y rclone
run: sudo apt-get install -y sshpass

- name: Configure rclone
- name: Configure known hosts
shell: bash
run: |
mkdir -p ~/.config/rclone/
conf=~/.config/rclone/rclone.conf
echo "[cdn]" >> $conf
echo "type = s3" >> $conf
echo "provider = Cloudflare" >> $conf
echo "access_key_id = ${{ inputs.cf-access-key-id }}" >> $conf
echo "secret_access_key = ${{ inputs.cf-secret-access-key }}" >> $conf
echo "endpoint = https://${{ inputs.cf-account-id }}.r2.cloudflarestorage.com" >> $conf
echo "acl = public-read" >> $conf
mkdir -p ~/.ssh
echo "${{ inputs.bunny-ssh-knownhosts }}" >> ~/.ssh/known_hosts
12 changes: 9 additions & 3 deletions .github/actions/cdn-upload-firmware/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: cdn-upload-firmware
description: Uploads firmware partitions and merged binaries to CDN along with SHA256 checksums
inputs:
cf-bucket:
description: Name of the S3 bucket
bunny-stor-hostname:
description: Bunny SFTP Hostname
required: true
bunny-stor-username:
description: Bunny SFTP Username
required: true
bunny-stor-password:
description: Bunny SFTP Password
required: true
fw-version:
description: Firmware version
Expand Down Expand Up @@ -49,4 +55,4 @@ runs:
mkdir -p upload
mv *.bin upload/
mv hashes.*.txt upload/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
sshpass -p "${{ inputs.bunny-stor-password }}" scp -r upload/ ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/${{ inputs.fw-version }}/${{ inputs.board }}
12 changes: 9 additions & 3 deletions .github/actions/cdn-upload-version-info/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: cdn-upload-version-info
description: Uploads version specific info to CDN
inputs:
cf-bucket:
description: Name of the S3 bucket
bunny-stor-hostname:
description: Bunny SFTP Hostname
required: true
bunny-stor-username:
description: Bunny SFTP Username
required: true
bunny-stor-password:
description: Bunny SFTP Password
required: true
fw-version:
description: Firmware version
Expand All @@ -27,4 +33,4 @@ runs:
run: |
mkdir -p upload
mv boards.txt upload/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
sshpass -p "${{ inputs.bunny-stor-password }}" scp -r upload/* ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/${{ inputs.fw-version }}/${{ inputs.board }}
10 changes: 5 additions & 5 deletions .github/scripts/get-vars.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const fs = require('fs');
const ini = require('ini');
const semver = require('semver');
const core = require('@actions/core');
const child_process = require('child_process');
import fs from 'fs';
import ini from 'ini';
import semver from 'semver';
import core from '@actions/core';
import child_process from 'child_process';

// Get branch name
const gitRef = process.env.GITHUB_REF;
Expand Down
Loading

1 comment on commit 5379918

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v18.1.8) reports: 4 file(s) not formatted
  • include/serialization/_fbs/GatewayToHubMessage_generated.h
  • include/serialization/_fbs/HubConfig_generated.h
  • include/serialization/_fbs/HubToGatewayMessage_generated.h
  • include/serialization/_fbs/OtaUpdateProgressTask_generated.h

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.