From 3e97d728f7b793d9d22c3101cf65929a26f7a1cb Mon Sep 17 00:00:00 2001 From: Jerome Wu Date: Wed, 5 Oct 2022 17:00:51 +0800 Subject: [PATCH] Build cores at the same time --- .github/workflows/CI.yml | 57 +++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 144a98f..b4e214c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,33 +21,58 @@ jobs: id: cache-build uses: actions/cache@v3 with: - path: | - build-cache-st - build-cache-mt - key: build-cache-v1-${{ hashFiles('Dockerfile', 'Makefile', 'build/*') }} + path: build-cache-st + key: build-cache-st-v1-${{ hashFiles('Dockerfile', 'Makefile', 'build/*') }} restore-keys: | - build-cache-v1- + build-cache-st-v1- - name: Build ffmpeg-core run: make prd EXTRA_ARGS="--cache-from=type=local,src=build-cache-st --cache-to=type=local,dest=build-cache-st,mode=max" - - name: Build ffmpet-core-mt - run: make prd-mt EXTRA_ARGS="--cache-from=type=local,src=build-cache-mt --cache-to=type=local,dest=build-cache-mt,mode=max" - - name: Upload core and core-mt + - name: Upload core uses: actions/upload-artifact@v3 with: - name: ffmpeg-cores - path: | - packages/core/dist/* - packages/core-mt/dist/* - tests: + name: ffmpeg-core + path: packages/core/dist/* + build-core-mt: runs-on: ubuntu-latest - needs: build-core steps: - name: Checkout Source Code uses: actions/checkout@v3 - - name: Download ffmpeg-cores + - name: Setup Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Cache build + id: cache-build + uses: actions/cache@v3 + with: + path: build-cache-mt + + key: build-cache-mt-v1-${{ hashFiles('Dockerfile', 'Makefile', 'build/*') }} + restore-keys: | + build-cache-v1- + - name: Build ffmpet-core-mt + run: make prd-mt EXTRA_ARGS="--cache-from=type=local,src=build-cache-mt --cache-to=type=local,dest=build-cache-mt,mode=max" + - name: Upload core-mt + uses: actions/upload-artifact@v3 + with: + name: ffmpeg-core-mt + path: packages/core-mt/dist/* + tests: + runs-on: ubuntu-latest + needs: + - build-core + - build-core-mt + steps: + - name: Checkout Source Code + uses: actions/checkout@v3 + - name: Download ffmpeg-core uses: actions/download-artifact@v3 with: - name: ffmpeg-cores + name: ffmpeg-core + path: packages + - name: Download ffmpeg-core-mt + uses: actions/download-artifact@v3 + with: + name: ffmpeg-core-mt path: packages - name: Use Node.js 16 uses: actions/setup-node@v3