Skip to content

Commit

Permalink
Update CI/CD Workflows (#495)
Browse files Browse the repository at this point in the history
* Add workflow dispatch for release workflows.

* Update macOS target for release workflows.

* Update all used Actions in the workflows to the latest version and pin them with hash.

* Force using node16 for Linux release publish workflow.
  • Loading branch information
philomath213 authored Oct 1, 2024
1 parent 363e4a4 commit 264b71f
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bazel_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
python-version: ['3.9']
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Run gtest
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Prepare ENV
Expand All @@ -32,7 +32,7 @@ jobs:
run: .github/workflows/scripts/install_req_windows.bat
if: ${{ matrix.os == 'windows-latest' }}
- name: Install dependencies Windows - msbuild
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
if: ${{ matrix.os == 'windows-latest' }}
- name: Build the library for Ubuntu/MacOS
run: .github/workflows/scripts/build_nix.sh
Expand All @@ -44,7 +44,7 @@ jobs:
run: |
pytest tests/python/benchmarks/ --cov-fail-under 0 --benchmark-json pytest_benchmarks_output.json
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29 # v1.20.3
with:
name: Python-Benchmarks
tool: "pytest"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ossar-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@v1
uses: github/ossar-action@4e96c4f6e591eb4b991abfd459e40b136a317aea # v2.0.0
id: ossar

# Upload results to the Security tab
- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@5618c9fc1e675841ca52c1c6b1304f5255a905a0 # v2.19.0
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
9 changes: 8 additions & 1 deletion .github/workflows/pythonpublish-linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Linux Package

on:
workflow_dispatch:
release:
types: [published]

Expand All @@ -17,9 +18,15 @@ jobs:

runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64

# node20 can't run on manylinux2014 as it requires newer version of GLIBC
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
env:
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Prepare ENV
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pythonpublish-macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: MacOS Package

on:
workflow_dispatch:
release:
types: [published]

Expand All @@ -10,14 +11,14 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [macos-11, macos-12]
os: [macos-12, macos-13, macos-14]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pythonpublish-windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Windows Package

on:
workflow_dispatch:
release:
types: [published]

Expand All @@ -12,17 +13,17 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: .github/workflows/scripts/install_req_windows.bat
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
python-version: ['3.8', '3.12']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -37,11 +37,11 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Check LongPathsEnabled
Expand All @@ -64,7 +64,7 @@ jobs:
run: .github/workflows/scripts/install_req_windows.bat
if: ${{ matrix.os == 'windows-latest' }}
- name: Install dependencies Windows - msbuild
uses: microsoft/setup-msbuild@v1.0.3
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
if: ${{ matrix.os == 'windows-latest' }}
- name: Build the library for Ubuntu/MacOS
run: .github/workflows/scripts/build_nix.sh
Expand All @@ -89,11 +89,11 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Prepare ENV
Expand All @@ -116,7 +116,7 @@ jobs:
run: .github/workflows/scripts/install_req_windows.bat
if: ${{ matrix.os == 'windows-latest' }}
- name: Install dependencies Windows - msbuild
uses: microsoft/setup-msbuild@v1.0.3
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
if: ${{ matrix.os == 'windows-latest' }}
- name: Build the library for Ubuntu/MacOS
run: .github/workflows/scripts/build_nix.sh
Expand Down

0 comments on commit 264b71f

Please sign in to comment.