From b3208cdb3ce03351d9201f5da5518bb80ac89ec8 Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Mon, 17 Feb 2025 17:03:53 +0900 Subject: [PATCH 1/5] ci: Adding manual build tests --- .github/workflows/build-test.yml | 73 ++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000000..28272c8b706 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -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. From 2d1c8dbbdde9c1229de31aa863302a748fd9a0a3 Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Wed, 19 Feb 2025 18:21:34 +0900 Subject: [PATCH 2/5] Update build-test.yml --- .github/workflows/build-test.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 28272c8b706..b62262cfd81 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -35,11 +35,6 @@ jobs: - 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: From cf69681b1322874a23a1609709f205d08e1e5e45 Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Wed, 19 Feb 2025 18:24:11 +0900 Subject: [PATCH 3/5] Update build-test.yml --- .github/workflows/build-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b62262cfd81..28272c8b706 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -35,6 +35,11 @@ jobs: - 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: From 6d085848c6a684465c968878bd797003d38f57d9 Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Wed, 19 Feb 2025 18:25:43 +0900 Subject: [PATCH 4/5] Update build-test.yml --- .github/workflows/build-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 28272c8b706..3c9fcc931b2 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,8 +1,7 @@ name: build-test on: - pull_request: - types: [opened, synchronize, reopened] + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From 3824edc90ac3eb3844f61373abdb7005ccf97eb4 Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Wed, 19 Feb 2025 18:41:18 +0900 Subject: [PATCH 5/5] Update build-test.yml --- .github/workflows/build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 3c9fcc931b2..5199e7bb912 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,7 +1,7 @@ name: build-test on: - workflow_dispatch: + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -17,7 +17,7 @@ jobs: # 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] + os: [ubuntu-22.04, ubuntu-22.04-arm64, macos-14-large, macOS] runs-on: ${{ matrix.os }} steps: - name: Check out the revision