Skip to content

Commit

Permalink
Auto Build (RobotWebTools#446)
Browse files Browse the repository at this point in the history
* (actions) auto build on pushes to develop

* Remove check on build folder

As build is update on push to develop

* (actions) only push build changes on one ROS distro

* (actions) Use RWT-bot token

* (actions) don't run if actor is RWT-bot
  • Loading branch information
MatthijsBurgh authored Jun 20, 2021
1 parent c8e7851 commit b654415
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
ci:
name: ${{ matrix.ros_distro }}
if: ${{ github.actor != 'RWT-bot' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -17,9 +18,16 @@ jobs:
node_version: [14]
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.RWT_BOT_PAT }}
- name: Docker pull
run: docker pull ros:${{ matrix.ros_distro }}-ros-core
- name: Docker build
run: docker build --build-arg ROS_DISTRO="${{ matrix.ros_distro }}" --build-arg NODE_VERSION="${{ matrix.node_version }}" -t roslibjsdocker .
- name: Tests
run: docker run -v $(pwd):/root/roslibjs --rm roslibjsdocker bash -i -c 'bash /root/roslibjs/test/build.bash'
- uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ github.event_name == 'push' && github.ref == 'develop' && matrix.ros_distro == 'noetic' }}
with:
commit_message: Update Build
file_pattern: 'build/*.js'
10 changes: 0 additions & 10 deletions test/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,3 @@ echo -e "\e[1m\e[35mnpm run test-examples\e[0m"
npm run test-examples
echo -e "\e[1m\e[35mnpm run test-workersocket\e[0m"
npm run test-workersocket

echo -e "\e[1m\e[35mChecking build folder is up-to-date with library\e[0m"
changed_build_files=$(git -C "$(git rev-parse --show-toplevel)" diff --name-only HEAD -- build)
if [ -n "$changed_build_files" ]
then
echo -e "\e[1m\e[31mBuild folder is out-of-sync with library. Build library, npm run build, and (ammend) commit\e[0m"
exit 1
else
echo -e "\e[1m\e[32mBuild folder is up-to-date with library\e[0m"
fi

0 comments on commit b654415

Please sign in to comment.