forked from aciocca/Formula-SAE-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementate alcune Github Action per automatizzare alcune fasi dello sviluppo del codice ## Linter Aggiunta action che è in grado di eseguire il linter (sia python che JS) e scansionare alcuni problemi del codice. Questa action si attiva solo quando viene aperta una PR per branch `develop` o `main`. Gli errori vengono riportarti come commenti quando si analizzano le modifiche dei file. ## DevBuild Aggiunta action in grado di eseguire la build per AARCH64, l'architettura del rasberry e produrre un eseguibile per questo. Questa action si attiva quando viene eseguito il push di qualche commit nel branch `testing-build`. L'action genera in automatico una PRE-RELEASE con l'eseguibile. Ogni volta che viene eseguita la pre-release viene aggiornata e si perde quella precedente. ## Production Build Aggiunta action in grado di generare la build per ARMV7 pronta per la produzione. L'action si attiva quando una PR verso il branch `main` viene mergiata con successo. Produce una RELEASE con il nome della PR (*il nome della PR non deve contenere spazi e dovrebbe essere del tipo V1.0*) e con l'eseguibile ## Dependabot Aggiunto supporto per il dependabot. Controlla: - pip - npm - github actions
- Loading branch information
Showing
5 changed files
with
204 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: "Build on ARM" | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'testing-build' | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
packages: write | ||
pull-requests: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Build on ARM | ||
uses: pguyot/arm-runner-action@v2 | ||
id: build_image | ||
with: | ||
copy_artifact_path: dist/react-pywebview-boilerplate | ||
copy_artifact_dest: . | ||
base_image: raspios_lite:latest | ||
cpu: cortex-a7 | ||
cpu_info: cpuinfo/raspberrypi_3b | ||
image_additional_mb: 4096 | ||
commands: | | ||
sudo apt update | ||
sudo apt install python3-pip -y | ||
pip3 install virtualenv | ||
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - | ||
sudo apt install nodejs -y | ||
npm install --global yarn | ||
yarn run init | ||
export CI=false | ||
yarn run build | ||
- name: Upload executable | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: devbuild | ||
path: react-pywebview-boilerplate | ||
|
||
prerelease: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Download Executable | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: devbuild | ||
- name: Create DevBuild | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
title: "Development Build" | ||
files: | | ||
react-pywebview-boilerplate |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Create Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
packages: write | ||
pull-requests: read | ||
|
||
jobs: | ||
build: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Build on ARM | ||
uses: pguyot/arm-runner-action@v2 | ||
id: build_image | ||
with: | ||
copy_artifact_path: dist/react-pywebview-boilerplate | ||
copy_artifact_dest: . | ||
base_image: raspios_lite:latest | ||
cpu: cortex-a7 | ||
cpu_info: cpuinfo/raspberrypi_3b | ||
image_additional_mb: 4096 | ||
commands: | | ||
sudo apt update | ||
sudo apt install python3-pip -y | ||
pip3 install virtualenv | ||
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - | ||
sudo apt install nodejs -y | ||
npm install --global yarn | ||
yarn run init | ||
yarn run build | ||
- name: Upload executable | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: releasebuild | ||
path: react-pywebview-boilerplate | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Download Executable | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: releasebuild | ||
- name: Create Release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "${{ github.event.pull_request.title }}" | ||
prerelease: false | ||
files: | | ||
react-pywebview-boilerplate |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Lint | ||
|
||
on: | ||
# Replace pull_request with pull_request_target if you | ||
# plan to use this action with forks, see the Limitations section | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
# Down scope as necessary via https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token | ||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
run-linters: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
# fix temporaneo. @Fabrizio ricontrollare configurazione di eslint | ||
- name: Install Node.js dependencies | ||
run: yarn install | ||
|
||
- name: Run linters | ||
uses: wearerequired/lint-action@v2 | ||
with: | ||
xo: true | ||
flake8: true |
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