move CI from travis to GitHub actions

This commit is contained in:
proddy
2020-09-15 21:21:27 +02:00
parent d2b4fd59ff
commit d1dfb370bf
10 changed files with 255 additions and 63 deletions

33
.github/workflows/EMS-ESP_CI.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: EMS-ESP CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
#on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
on:
pull_request:
jobs:
emsesp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U platformio
# platformio upgrade --dev
platformio upgrade
platformio update
- name: Run PlatformIO
run: |
platformio run

89
.github/workflows/EMS-ESP_build.yml vendored Normal file
View File

@@ -0,0 +1,89 @@
name: Build_firmware
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
#on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
on:
push:
branches: [ dev ]
jobs:
# emsesp_pull:
# runs-on: ubuntu-latest
# continue-on-error: true
# steps:
# - uses: actions/checkout@v1
# - name: Use latest EMS-ESP development
# run: |
# git config --local user.name "Platformio BUILD"
# git switch -c main
# git remote add -f EMS-ESP "https://github.com/proddy/EMS-ESP.git"
# git merge EMS-ESP/dev --allow-unrelated-histories
# - name: Push EMS-ESP # Push updates of latest EMS-ESP development to repo
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: 'dev'
# force: true
emsesp:
# needs: emsesp_pull
runs-on: ubuntu-latest
# continue-on-error: true
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U platformio
# platformio upgrade --dev
platformio upgrade
platformio update
- name: Run PlatformIO
run: |
platformio run
- uses: actions/upload-artifact@v2
with:
name: firmware
path: ./build/firmware
Upload:
needs: [emsesp]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: firmware
path: ./mv_firmware
- name: Display structure of downloaded files
run: ls -R
working-directory: ./mv_firmware
- name: Move firmware files in sub-folders
run: |
mkdir -p ./firmware
mkdir -p ./firmware/tasmota32/ESP32_needed_files/
[ ! -f ./mv_firmware/*.bin ] || mv ./mv_firmware/EMS-ESP*.* ./firmware/
[ ! -f ./FIRMWARE.md ] || mv -f ./FIRMWARE.md ./README.md
- name: Commit files # transfer the new binaries back into the repository
run: |
git config --local user.name "Platformio BUILD"
git rm -r --cached .
git add ./README.md
git add -f ./firmware/*.*
git commit -m "EMS-ESP binaries"
- name: Push changes # push the firmware files to branch firmware
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'firmware'
force: true

20
.github/workflows/EMS-ESP_cpp_make.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: EMS-ESP C/C++ make
on:
push:
# branches: [ dev ]
pull_request:
# branches: [ dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: make clean
run: make clean
- name: make
run: make

View File

@@ -1,63 +0,0 @@
name: "CodeQL"
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 11 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp', 'javascript', 'python']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1