From 8a93753951763f36c992fbd422362e10f5afde49 Mon Sep 17 00:00:00 2001 From: Shingo Kitagawa Date: Fri, 27 Jan 2023 21:12:09 +0900 Subject: [PATCH] add ga python check --- .github/workflows/python2.yml | 18 ++++++++++++++++++ .github/workflows/python3.yml | 22 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/python2.yml create mode 100644 .github/workflows/python3.yml diff --git a/.github/workflows/python2.yml b/.github/workflows/python2.yml new file mode 100644 index 000000000..72f28a322 --- /dev/null +++ b/.github/workflows/python2.yml @@ -0,0 +1,18 @@ +# generated by `./generate_action_config.py noetic` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python2 + + container: ubuntu:20.04 + + steps: + - name: Chcekout + uses: actions/checkout@v2 + - name: Check Python2 + run: | + apt update -q && apt install -y -q python2 + python2 -m compileall . diff --git a/.github/workflows/python3.yml b/.github/workflows/python3.yml new file mode 100644 index 000000000..2e6dc49d3 --- /dev/null +++ b/.github/workflows/python3.yml @@ -0,0 +1,22 @@ +# generated by `./generate_action_config.py noetic` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python3 + + container: ubuntu:20.04 + + steps: + - name: Install latest git to download .git directory in actions/checkout@v2 ( use sudo for ros-ubuntu ) + run: apt-get update && apt-get install -y software-properties-common && apt-get update && add-apt-repository -y ppa:git-core/ppa && apt-get update && apt-get install -y git + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Chcekout + uses: actions/checkout@v2 + - name: Check Python3 + run: | + apt update -q && apt install -y -q python3 git 2to3 + bash -c "ret=0; trap 'ret=1' ERR; python3 -m compileall .; 2to3 -w -f except -f execfile -f has_key -f import -f raw_input -f zip .; git diff --exit-code . > /dev/null; echo Exitting with \$ret; exit \$ret"