From 4ff28c49b34e5a6559b5d5d2d713569eb3564cd9 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 14 Apr 2022 09:27:44 +0200 Subject: [PATCH] =?UTF-8?q?BOTH:=20python=20=E2=9C=85,=20python2=20?= =?UTF-8?q?=E2=9C=85,=20python3=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/detect_python.yml | 71 +++++++++++++++++++++++++++++ .github/workflows/node.js.yml | 38 --------------- 2 files changed, 71 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/detect_python.yml delete mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/detect_python.yml b/.github/workflows/detect_python.yml new file mode 100644 index 0000000..b195f02 --- /dev/null +++ b/.github/workflows/detect_python.yml @@ -0,0 +1,71 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the +# source code and run tests across different versions of node +# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: detect_python + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [12.x, 14.x, 16.x] # https://nodejs.org/en/about/releases/ + steps: + - run: brew install python-launcher # just to ensure this does not create conflicts + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + + # GitHub Actions defaults to having both Python 2 and 3 installed with `python` always pointing to `python3` + - name: "BOTH: python ✅, python2 ✅, python3 ✅" + run: | + py --list + echo -n "python " && python --version + echo -n "python2 " && python2 --version + echo -n "python3 " && python3 --version + npm run ci + + # Let's disable Python 3 + - name: "PY2 ONLY: python 🚫, python2 ✅, python3 🚫" + run: | + sudo mv /usr/bin/python3.8 /usr/bin/python3.8.disabled + py --list + echo -n "python " && python --version || true + echo -n "python2 " && python2 --version + echo -n "python3 " && python3 --version || true + npm run ci || true + + # Let's disable Python 2 + - name: "NONE: python 🚫, python2 🚫, python3 🚫" + run: | + sudo mv /usr/bin/python2.7 /usr/bin/python2.7.disabled + py --list || true + echo -n "python " && python --version || true + echo -n "python2 " && python2 --version || true + echo -n "python3 " && python3 --version || true + npm run ci || true + + # Let's re-enable Python 3 + - name: "Py3 ONLY: python ✅, python2 🚫, python3 ✅" + run: | + sudo mv /usr/bin/python3.8.disabled /usr/bin/python3.8 + py --list + echo -n "python " && python --version + echo -n "python2 " && python2 --version || true + echo -n "python3 " && python3 --version + npm run ci || true + + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index d7c87c3..0000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x, 14.x, 16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - python-version: ["2.7", "3.7", "3.10", "pypy-3.8"] - # See supported Python release schedule at https://devguide.python.org/#status-of-python-branches - steps: - - run: brew install python-launcher # just to ensure this does not create conflicts - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: Use Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - node-version: ${{ matrix.python-version }} - - run: py --list - - run: npm install - - run: npm run ci - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }}