chore: Use matrix for npm && Fix test directory

This commit is contained in:
강동윤 (Donny) 2024-08-20 11:13:48 +09:00
parent 465735594b
commit cf73dbbb92
2 changed files with 32 additions and 38 deletions

View File

@ -233,13 +233,13 @@ jobs:
image: ${{ matrix.settings.docker }}
options: -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build
run: >-
cd ./packages/core &&
cd ./packages/${{ inputs.package }} &&
npm install -f -g yarn@1.22 &&
corepack enable &&
npm i -g wasm-pack &&
${{ matrix.settings.build }}
- name: Build
working-directory: ./packages/core
working-directory: ./packages/${{ inputs.package }}
if: ${{ !matrix.settings.docker }}
run: ${{ matrix.settings.build }}
shell: bash
@ -285,15 +285,15 @@ jobs:
uses: actions/download-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: ./packages/core
path: ./packages/${{ inputs.package }}
- name: List packages
run: ls -R .
shell: bash
- name: Build TypeScript
working-directory: ./packages/core
working-directory: ./packages/${{ inputs.package }}
run: yarn build:ts
- name: Test bindings
working-directory: ./packages/core
working-directory: ./packages/${{ inputs.package }}
run: yarn test
test-linux-x64-gnu-binding:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
@ -324,7 +324,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: bindings-x86_64-unknown-linux-gnu
path: ./packages/core
path: ./packages/${{ inputs.package }}
- name: List packages
run: ls -R .
shell: bash
@ -364,7 +364,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: bindings-x86_64-unknown-linux-musl
path: ./packages/core
path: ./packages/${{ inputs.package }}
- name: List packages
run: ls -R .
shell: bash
@ -387,7 +387,7 @@ jobs:
# uses: actions/download-artifact@v3
# with:
# name: bindings-aarch64-unknown-linux-musl
# path: ./packages/core
# path: ./packages/${{ inputs.package }}
# - name: List packages
# run: ls -R .
# shell: bash
@ -435,7 +435,7 @@ jobs:
# uses: actions/download-artifact@v3
# with:
# name: bindings-armv7-unknown-linux-gnueabihf
# path: ./packages/core
# path: ./packages/${{ inputs.package }}
# - name: List packages
# run: ls -R .
# shell: bash
@ -491,15 +491,15 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: ./packages/core/artifacts
path: ./packages/${{ inputs.package }}/artifacts
- name: List binaries
run: ls -R ./packages/core/artifacts
run: ls -R ./packages/${{ inputs.package }}/artifacts
shell: bash
- name: Move binaries
shell: bash
working-directory: ./packages/core
working-directory: ./packages/${{ inputs.package }}
run: |
./scripts/cli_artifacts.sh
ls -R ./artifacts_cli
@ -507,7 +507,7 @@ jobs:
- name: List npm
run: ls -R ./scripts/npm
working-directory: ./packages/core
working-directory: ./packages/${{ inputs.package }}
shell: bash
- name: Set fallback dependencies

View File

@ -146,9 +146,14 @@ jobs:
version: ${{ needs.determine-nightly-version.outputs.version }}
ssh-private-key: ${{ secrets.SWC_BOT_SSH }}
publish-core-nightly:
name: "Publish ${{ needs.determine-nightly-version.outputs.version }}"
publish-npm-nightly:
name: "Publish ${{ matrix.package }}@${{ needs.determine-nightly-version.outputs.version }}"
strategy:
fail-fast: false
matrix:
package:
- core
- html
needs:
- git-tag-nightly
- publish-cargo
@ -156,34 +161,18 @@ jobs:
uses: ./.github/workflows/publish-npm-package.yml
secrets: inherit
with:
package: "core"
package: ${{ matrix.package }}
version: ${{ needs.determine-nightly-version.outputs.version }}
buildCli: true
skipBuild: ${{ inputs.skipBuild || false }}
skipPublishing: ${{ github.event_name == 'pull_request' }}
publish-html-nightly:
name: "Publish html@${{ needs.determine-nightly-version.outputs.version }}"
needs:
- git-tag-nightly
- publish-cargo
- determine-nightly-version
uses: ./.github/workflows/publish-npm-package.yml
secrets: inherit
with:
package: "html"
version: ${{ needs.determine-nightly-version.outputs.version }}
buildCli: false
skipBuild: ${{ inputs.skipBuild || false }}
skipPublishing: ${{ github.event_name == 'pull_request' }}
run-ecosystem-ci-with-nightly:
name: "Test nightly using ecosystem CI"
needs:
- determine-nightly-version
- publish-core-nightly
- publish-npm-nightly
uses: ./.github/workflows/ecosystem-ci.yml
with:
version: ${{ needs.determine-nightly-version.outputs.version }}
@ -204,9 +193,14 @@ jobs:
version: ${{ inputs.version }}
ssh-private-key: ${{ secrets.SWC_BOT_SSH }}
publish-core-stable:
name: "Publish ${{ inputs.version || 'stable' }} to npm"
publish-npm-stable:
name: "Publish ${{ matrix.package }}}}@${{ inputs.version || 'stable' }} to npm"
strategy:
fail-fast: false
matrix:
package:
- core
- html
needs:
- publish-cargo
- run-ecosystem-ci-with-nightly
@ -214,7 +208,7 @@ jobs:
uses: ./.github/workflows/publish-npm-package.yml
secrets: inherit
with:
package: "core"
package: ${{ matrix.package }}
version: ${{ inputs.version }}
buildCli: true
skipBuild: ${{ inputs.skipBuild || inputs.onlyNightly || false }}