From 9191724b3b08c4aa131c24e5616ebb7dfc12e31a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 9 Mar 2023 09:23:05 -0500 Subject: [PATCH 1/3] add report-python-information --- report-python-information/action.yml | 34 ++++++++++++++++++++++++++++ report-python-information/readme.md | 8 +++++++ 2 files changed, 42 insertions(+) create mode 100644 report-python-information/action.yml create mode 100644 report-python-information/readme.md diff --git a/report-python-information/action.yml b/report-python-information/action.yml new file mode 100644 index 00000000..e5828c4e --- /dev/null +++ b/report-python-information/action.yml @@ -0,0 +1,34 @@ +name: "Report Python information" + +description: "Reports various Python build and library information including SQLite and OpenSSL versions." + +runs: + using: "composite" + steps: + - name: Python + shell: sh + run: | + python --version --version + + - name: Installed packages + shell: sh + run: | + python -m pip --version + python -m pip freeze + + - name: SQLite + shell: sh + run: | + python -c 'import sqlite3; print(f"sqlite3.sqlite_version: {sqlite3.sqlite_version}")' + + - name: OpenSSL + shell: sh + run: | + python -c 'import ssl; print(f"ssl.OPENSSL_VERSION: {ssl.OPENSSL_VERSION}")' + python -c 'import ssl; print(f"ssl.OPENSSL_VERSION_NUMBER: {ssl.OPENSSL_VERSION_NUMBER}")' + + - name: Python sysconfig + shell: sh + run: | + python -m sysconfig + diff --git a/report-python-information/readme.md b/report-python-information/readme.md new file mode 100644 index 00000000..a9ff1c97 --- /dev/null +++ b/report-python-information/readme.md @@ -0,0 +1,8 @@ +# Report Python information + +Reports various Python build and library information including SQLite and OpenSSL versions. +Consider making sure the env you want to check is activated first, if needed. + +```yaml +- uses: Chia-Network/actions/report-python-information@main +``` From 6eaa259442947f312034f674f5204e63690471b1 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 9 Mar 2023 09:37:14 -0500 Subject: [PATCH 2/3] move pip freeze after the short version info dumps --- report-python-information/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/report-python-information/action.yml b/report-python-information/action.yml index e5828c4e..02119974 100644 --- a/report-python-information/action.yml +++ b/report-python-information/action.yml @@ -10,12 +10,6 @@ runs: run: | python --version --version - - name: Installed packages - shell: sh - run: | - python -m pip --version - python -m pip freeze - - name: SQLite shell: sh run: | @@ -27,6 +21,12 @@ runs: python -c 'import ssl; print(f"ssl.OPENSSL_VERSION: {ssl.OPENSSL_VERSION}")' python -c 'import ssl; print(f"ssl.OPENSSL_VERSION_NUMBER: {ssl.OPENSSL_VERSION_NUMBER}")' + - name: Installed packages + shell: sh + run: | + python -m pip --version + python -m pip freeze + - name: Python sysconfig shell: sh run: | From 48a05de33721d1317925dae24e3ec7e625d18981 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 29 Mar 2023 21:43:34 -0400 Subject: [PATCH 3/3] add a "test" --- .../test-report-python-information.yml | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 .github/workflows/test-report-python-information.yml diff --git a/.github/workflows/test-report-python-information.yml b/.github/workflows/test-report-python-information.yml new file mode 100644 index 00000000..551f3f82 --- /dev/null +++ b/.github/workflows/test-report-python-information.yml @@ -0,0 +1,172 @@ +name: test-report-python-information + +on: + push: + branches: + - main + tags: + - '**' + pull_request: + branches: + - '**' + +concurrency: + # SHA is added to the end if on `main` to let all main workflows run + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} + cancel-in-progress: true + +jobs: + test: + name: ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.name }} + runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} + container: ${{ matrix.os.container[matrix.python.matrix] }} + strategy: + fail-fast: false + matrix: + os: + - name: macOS + matrix: macos + native-python: false + runs-on: + arm: [macOS, ARM64] + intel: [macos-latest] + - name: Ubuntu + matrix: ubuntu + native-python: false + runs-on: + arm: [Linux, ARM64] + intel: [ubuntu-latest] + - name: Docker Debian + matrix: docker-debian + native-python: true + runs-on: + arm: [Linux, ARM64] + intel: [ubuntu-latest] + container: + 'py3.7': docker://python:3.7-bullseye + 'py3.8': docker://python:3.8-bullseye + 'py3.9': docker://python:3.9-bullseye + 'py3.10': docker://python:3.10-bullseye + 'py3.11': docker://python:3.11-bullseye + - name: Windows + matrix: windows + native-python: false + runs-on: + intel: [windows-latest] + python: + - name: '3.7' + action: '3.7' + check: '3.7' + matrix: 'py3.7' + - name: '3.8' + action: '3.8' + check: '3.8' + matrix: 'py3.8' + - name: '3.9' + action: '3.9' + check: '3.9' + matrix: 'py3.9' + - name: '3.10' + action: '3.10' + check: '3.10' + matrix: 'py3.10' + - name: '3.11' + action: '3.11' + check: '3.11' + matrix: 'py3.11' + arch: + - name: ARM + matrix: arm + - name: Intel + matrix: intel + include: + - os: + name: Chia Network Ubuntu Intel Builder + matrix: docker-chia-network-ubuntu-intel-builder + native-python: true + runs-on: + intel: [ubuntu-latest] + container: + '3.8': chianetwork/ubuntu-18.04-builder:latest + python: + name: '3.8' + check: '3.8' + matrix: '3.8' + arch: + name: Intel + matrix: intel + - os: + name: Chia Network Ubuntu ARM Builder + matrix: docker-chia-network-ubuntu-arm-builder + native-python: true + runs-on: + arm: [Linux, ARM64] + container: + '3.8': chianetwork/ubuntu-18.04-builder:latest + python: + name: '3.8' + check: '3.8' + matrix: '3.8' + arch: + name: ARM + matrix: arm + - os: + name: Chia Network CentOS Intel Builder + matrix: docker-chia-network-centos-intel-builder + native-python: true + runs-on: + intel: [ubuntu-latest] + container: + '3.9': chianetwork/centos7-builder:latest + python: + name: '3.9' + check: '3.9' + matrix: '3.9' + arch: + name: Intel + matrix: intel + exclude: + # Only partial entries are required here by GitHub Actions so generally I + # only specify the `matrix:` entry. The super linter complains so for now + # all entries are included to avoid that. Reported at + # https://github.com/rhysd/actionlint/issues/249 + - os: + name: Windows + matrix: windows + native-python: false + runs-on: + intel: [windows-latest] + arch: + name: ARM + matrix: arm + - os: + name: macOS + matrix: macos + native-python: false + runs-on: + arm: [macOS, ARM64] + intel: [macos-latest] + python: + name: '3.7' + action: '3.7' + check: '3.7' + matrix: 'py3.7' + arch: + name: ARM + matrix: arm + + steps: + - uses: actions/checkout@v3 + with: + path: repo + + - name: Set up ${{ matrix.python.name }} + if: ${{ ! matrix.os.native-python }} + uses: ./repo/setup-python + with: + python-version: ${{ matrix.python.action }} + + - name: Run the action + uses: ./repo/report-python-information + +# even just not failing is a useful check