Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(BA-777): Adding manual build tests #3728

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: build-test

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

build-scies:
strategy:
fail-fast: false
matrix:
# ubuntu-22.04: x86-64
# ubuntu-22.04-arm64: aarch64
# macos-14-large: intel
# macos-14-xlarge: apple silicon
os: [ubuntu-22.04, ubuntu-22.04-arm64, macos-14-xlarge, macos-14-large]
runs-on: ${{ matrix.os }}
steps:
- name: Check out the revision
uses: actions/checkout@v4
- name: Fetch remote tags
run: git fetch origin 'refs/tags/*:refs/tags/*' -f
- name: Git LFS Pull
run: git lfs pull
- name: Extract Python version from pants.toml
run: |
PYTHON_VERSION=$(awk -F'["]' '/CPython==/ {print $2; exit}' pants.toml | sed 's/CPython==//')
echo "PANTS_CONFIG_FILES=pants.ci.toml" >> $GITHUB_ENV
echo "PROJECT_PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
- name: Install coreutils for macOS
if: ${{ startsWith(matrix.os, 'macos') }}
run: brew install coreutils
- name: Set up Python as Runtime
uses: actions/setup-python@v5
with:
python-version: ${{ env.PROJECT_PYTHON_VERSION }}
cache: "pip"
- name: Bootstrap Pants
uses: pantsbuild/actions/init-pants@v8
with:
gha-cache-key: pants-cache-main-1-deploy-py${{ env.PROJECT_PYTHON_VERSION }}-${{ runner.os }}-${{ runner.arch }}
named-caches-hash: ${{ hashFiles('python*.lock', 'tools/*.lock') }}
cache-lmdb-store: 'false'
- name: Build both lazy and fat packages
run: |
pants --tag="scie" package '::'
# Rename artifacts to have the platform suffix
platform_suffix="$(python scripts/get-platform-suffix.py)"
for artifact in dist/backendai-*; do
mv "${artifact}" "${artifact}-${platform_suffix}"
done
# Generate checksums. NOTE: 'pants run' does not support parallelization
pants list --filter-tag-regex='checksum' '::' | xargs -n 1 pants run
# Merge checksums into a single file
cat dist/*.sha256 > dist/checksum.txt
sort -u dist/checksum.txt -o dist/checksum.txt
rm dist/*.sha256
- name: Upload scies
uses: actions/upload-artifact@v4
with:
name: scies-${{ matrix.os }}
path: dist/*
- name: Upload pants log
uses: actions/upload-artifact@v4
with:
name: pants-${{ matrix.os }}.build-scies.log
path: .pants.d/workdir/pants.log
if: always() # We want the log even on failures.
Loading