1
mirror of https://github.com/ThePhaseless/Byparr.git synced 2025-03-15 17:50:21 +08:00

use matrix for build

This commit is contained in:
Thephaseless 2024-12-11 00:40:11 +00:00
parent 986f7446bf
commit c5f442a4af
4 changed files with 11 additions and 14 deletions

@ -24,7 +24,15 @@ env:
jobs: jobs:
build: build:
runs-on: ubuntu-latest strategy:
matrix:
include:
- os: ubuntu-latest
arch: amd64
- os: ubuntu-latest-arm
arch: arm64
runs-on: ${{ matrix.os }}
permissions: permissions:
contents: read contents: read
packages: write packages: write
@ -78,7 +86,7 @@ jobs:
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64 platforms: linux/${{ matrix.arch }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
target: test target: test
@ -93,7 +101,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64 platforms: linux/${{ matrix.arch }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
build-args: GITHUB_BUILD=true,VERSION=${{ github.ref_name }} build-args: GITHUB_BUILD=true,VERSION=${{ github.ref_name }}

@ -23,9 +23,6 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
COPY pyproject.toml uv.lock ./ COPY pyproject.toml uv.lock ./
RUN uv sync RUN uv sync
COPY github_actions_fix.sh ./
RUN ./github_actions_fix.sh
COPY . . COPY . .
RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver

4
cmd.sh

@ -1,7 +1,3 @@
#!/bin/sh #!/bin/sh
if [ -f ld_fix.sh ]; then
. ./ld_fix.sh
fi
uv run main.py uv run main.py

@ -1,7 +1,3 @@
#!/bin/sh #!/bin/sh
if [ -f ./ld_fix.sh ]; then
. ./ld_fix.sh
fi
uv run pytest --retries 2 -n auto --xvfb uv run pytest --retries 2 -n auto --xvfb