From 5830c3d177dbe09cfaa59b1ba7bbde3bad4e3486 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 15 Dec 2025 11:46:31 +0800 Subject: [PATCH] Add Redis and Apple Private Key Setup to CI Workflows - Added the `OPENAI_API_KEY` environment variable to both `pr-test.yml` and `unit-test.yml` workflows for improved API access. - Introduced a step to set up the Apple Private Key in both workflows, enhancing security for Apple-related operations. - Integrated Redis service setup in both workflows to support caching and improve test performance. --- .github/workflows/pr-test.yml | 16 ++++++++++++++++ .github/workflows/unit-test.yml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index ea148165..1c541061 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -40,6 +40,7 @@ env: OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }} TEST_MOAPI_SECRET: ${{ secrets.OPENAI_TEST_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_TEST_KEY }} TEST_MOAPI_MIRROR: https://api.openai.com # DeepSeek API Configuration @@ -314,11 +315,21 @@ jobs: with: ref: ${{ env.HEAD }} + - name: Setup Apple Private Key + run: | + mkdir -p ../app/openapi/certs/apple + echo "${{ secrets.APPLE_PRIVATE_KEY_USER }}" > ../app/openapi/certs/apple/signin_client_secret_key.p8 + - name: Setup Go ${{ matrix.go }} uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} + - name: Start Redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + - name: Setup Go Tools run: make tools @@ -468,6 +479,11 @@ jobs: with: go-version: ${{ matrix.go }} + - name: Start Redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + - name: Setup Go Tools run: make tools diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index c936b7a1..c3bf659d 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -44,6 +44,7 @@ env: OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }} TEST_MOAPI_SECRET: ${{ secrets.OPENAI_TEST_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_TEST_KEY }} TEST_MOAPI_MIRROR: https://api.openai.com # DeepSeek API Configuration @@ -273,11 +274,21 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 + - name: Setup Apple Private Key + run: | + mkdir -p ../app/openapi/certs/apple + echo "${{ secrets.APPLE_PRIVATE_KEY_USER }}" > ../app/openapi/certs/apple/signin_client_secret_key.p8 + - name: Setup Go ${{ matrix.go }} uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} + - name: Start Redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + - name: Setup Go Tools run: make tools @@ -379,6 +390,11 @@ jobs: with: go-version: ${{ matrix.go }} + - name: Start Redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + - name: Setup Go Tools run: make tools