From bcc2e86e6f508ab2cf9424f3309d2e3d890844ba Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Sat, 29 May 2021 05:27:20 +0300 Subject: [PATCH] CI: split up to several workflows --- .github/workflows/build-image.yaml | 29 +++++++++++++ .github/workflows/build.yml | 16 +++++++ .github/workflows/{main.yml => docs.yml} | 55 +----------------------- .github/workflows/editorconfig.yaml | 18 ++++++++ 4 files changed, 64 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/build-image.yaml create mode 100644 .github/workflows/build.yml rename .github/workflows/{main.yml => docs.yml} (51%) create mode 100644 .github/workflows/editorconfig.yaml diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml new file mode 100644 index 00000000..714ce891 --- /dev/null +++ b/.github/workflows/build-image.yaml @@ -0,0 +1,29 @@ +name: Build RPi image + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ master ] + release: + types: [ created ] + +jobs: + build-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build image + run: | + docker run --privileged --rm -v /dev:/dev -v $(pwd):/builder/repo -e TRAVIS_TAG="${{ github.event.release.tag_name }}" sfalexrog/img-tool:qemu-update + - name: Compress image + run: | + sudo chmod -R 777 images && zip -9 $(echo images/clover_*).zip images/clover_* && ls -l images + - name: Upload image + uses: softprops/action-gh-release@v1 + if: ${{ github.event_name == 'release' }} + with: + files: images/clover_*.zip + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..0709e465 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,16 @@ +name: Build + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ master ] + +jobs: + build-melodic: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Native Melodic build + run: | + docker run --rm -v $(pwd):/root/catkin_ws/src/clover ros:melodic-ros-base /root/catkin_ws/src/clover/builder/standalone-install.sh diff --git a/.github/workflows/main.yml b/.github/workflows/docs.yml similarity index 51% rename from .github/workflows/main.yml rename to .github/workflows/docs.yml index 902741c2..d0cdd5ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/docs.yml @@ -1,40 +1,12 @@ -# This is a basic workflow to help you get started with Actions +name: Documentation -name: CI - -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch push: branches: [ '*' ] pull_request: branches: [ master ] - release: - types: [ created ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build-image: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build image - run: | - docker run --privileged --rm -v /dev:/dev -v $(pwd):/builder/repo -e TRAVIS_TAG="${{ github.event.release.tag_name }}" sfalexrog/img-tool:qemu-update - - name: Compress image - run: | - sudo chmod -R 777 images && zip -9 $(echo images/clover_*).zip images/clover_* && ls -l images - - name: Upload image - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/v') - with: - files: images/clover_*.zip - prerelease: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} documentation: runs-on: ubuntu-18.04 steps: @@ -82,28 +54,3 @@ jobs: token: ${{ secrets.DOCS_DEPLOY_TOKEN }} clean: true single-commit: true # to avoid multiple copies of large pdf files - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Runs a set of commands using the runners shell - - name: Native Melodic build - env: - NATIVE_DOCKER: ros:melodic-ros-base - run: | - docker run --rm -v $(pwd):/root/catkin_ws/src/clover ${NATIVE_DOCKER} /root/catkin_ws/src/clover/builder/standalone-install.sh - editorconfig: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: .editorconfig Linter - run: | - wget --no-verbose https://github.com/okalachev/editorconfig-checker/releases/download/1.2.1-disable-spaces-amount/ec-linux-amd64 - chmod +x ec-linux-amd64 - ./ec-linux-amd64 -spaces-after-tabs -e "roslib.js|ros3d.js|eventemitter2.js|draw.cpp|BinUtils.swift|\.idea|apps/android/app|blockly/|clover_blocks/programs/|highlight/|python.js|Assets.xcassets|test_parser_pass.txt|test_node_failure.txt|aruco_pose/vendor|\.stl|\.dxf|\.dae" diff --git a/.github/workflows/editorconfig.yaml b/.github/workflows/editorconfig.yaml new file mode 100644 index 00000000..9bbeba47 --- /dev/null +++ b/.github/workflows/editorconfig.yaml @@ -0,0 +1,18 @@ +name: Editorconfig lint + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ master ] + +jobs: + editorconfig: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: .editorconfig Linter + run: | + wget --no-verbose https://github.com/okalachev/editorconfig-checker/releases/download/1.2.1-disable-spaces-amount/ec-linux-amd64 + chmod +x ec-linux-amd64 + ./ec-linux-amd64 -spaces-after-tabs -e "roslib.js|ros3d.js|eventemitter2.js|draw.cpp|BinUtils.swift|\.idea|apps/android/app|blockly/|clover_blocks/programs/|highlight/|python.js|Assets.xcassets|test_parser_pass.txt|test_node_failure.txt|aruco_pose/vendor|\.stl|\.dxf|\.dae"