Skip to content

Commit

Permalink
(actions) use container (#553)
Browse files Browse the repository at this point in the history
* (actions) use container

* (actions) don't run as root

https://github.community/t/how-to-run-action-as-a-non-root-user/17572

* (actions) fix syntax

https://github.community/t/how-to-run-action-as-a-non-root-user/17572

* (actions) apt needs sudo with other user

* [temp] (actions)get node version

* (actions) don't use when calling NPM

* (actions) remove get node version sudo

* (actions) remove get node version sudo -H

* (actions) ll /github

* (actions) ll -> ls -alF

* (actions) own /github

* (actions) cleanup

* (setup_examples) cleanup

* (actions) remove ls

* (test) remove prints

* Delete Dockerfile
  • Loading branch information
MatthijsBurgh authored Aug 15, 2022
1 parent 7aac4c5 commit c74032b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,42 @@ name: CI

on: [push, pull_request]

defaults:
run:
shell: bash

jobs:
ci:
name: ${{ matrix.ros_distro }}
if: ${{ github.actor != 'RWT-bot' }}
runs-on: ubuntu-latest
container: ros:${{ matrix.ros_distro }}-ros-core
strategy:
fail-fast: false
matrix:
ros_distro: [melodic, noetic]
node_version: [14]
env:
ROS_DISTRO: ${{ matrix.ros_distro }}
steps:
- uses: actions/checkout@v3
env:
TOKEN: "${{ github.event_name == 'push' && endsWith(github.ref, 'develop') && matrix.ros_distro == 'noetic' && secrets.RWT_BOT_PAT || github.token }}"
with:
token: ${{ env.TOKEN }}
- 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 .
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Own /github/home
run: |
chown -hR $(whoami):$(whoami) /github/home
- name: Install apt dependencies
run: |
apt-get update
apt-get install -y firefox ros-$ROS_DISTRO-rosbridge-server ros-$ROS_DISTRO-tf2-web-republisher ros-$ROS_DISTRO-common-tutorials ros-$ROS_DISTRO-rospy-tutorials ros-$ROS_DISTRO-actionlib-tutorials
- name: Tests
run: docker run -v $(pwd):/root/roslibjs --rm roslibjsdocker bash -i -c 'bash /root/roslibjs/test/build.bash'
run: |
bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && bash test/build.bash"
- uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ github.event_name == 'push' && endsWith(github.ref, 'develop') && matrix.ros_distro == 'noetic' }}
with:
Expand Down
18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

0 comments on commit c74032b

Please sign in to comment.