ci: applying security recommendations: Pinned-Dependencies #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check build | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
permissions: | |
contents: read | |
jobs: | |
build-test: | |
runs-on: 'ubuntu-latest' | |
permissions: | |
contents: read | |
steps: | |
- name: Harden the runner (Audit all outbound calls) | |
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set Up Python | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
with: | |
cache: 'pip' | |
cache-dependency-path: 'requirements.txt' | |
python-version: '3.8.18' | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip==24.0 | |
pip install -r requirements.txt | |
pip install build==1.1.1 | |
- name: Build | |
shell: python | |
run: | | |
import os | |
import subprocess | |
def build_wheel(): | |
if not os.path.exists('dist'): | |
os.makedirs('dist') | |
subprocess.check_call([ 'python', '-m', 'build', '--wheel' ]) | |
build_wheel() | |