From 65e1adcab7fd13e805556967018e55b5acb32a96 Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Thu, 9 May 2024 10:58:39 +0800 Subject: [PATCH] fix: ci test --- .github/workflows/CI.yml | 76 ++++++++++++++++++++++++++++++++++++++-- __test__/index.spec.mjs | 2 +- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c1a51c8..3b5ff47 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -143,7 +143,6 @@ jobs: - host: windows-latest target: x86_64-pc-windows-msvc node: - - '14' - '16' - '18' runs-on: ${{ matrix.settings.host }} @@ -175,7 +174,6 @@ jobs: fail-fast: false matrix: node: - - '14' - '16' - '18' runs-on: ubuntu-latest @@ -207,7 +205,6 @@ jobs: fail-fast: false matrix: node: - - '14' - '16' - '18' runs-on: ubuntu-latest @@ -233,6 +230,79 @@ jobs: shell: bash - name: Test bindings run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-alpine yarn test + test-linux-aarch64-gnu-binding: + name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }} + needs: + - build + strategy: + fail-fast: false + matrix: + node: + - '16' + - '18' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: bindings-aarch64-unknown-linux-gnu + path: . + - name: List packages + run: ls -R . + shell: bash + - name: Install dependencies + run: | + yarn config set supportedArchitectures.cpu "arm64" + yarn config set supportedArchitectures.libc "glibc" + yarn install + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests + uses: addnab/docker-run-action@v3 + with: + image: node:${{ matrix.node }}-slim + options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' + run: | + set -e + yarn test + ls -la + test-linux-aarch64-musl-binding: + name: Test bindings on aarch64-unknown-linux-musl - node@lts + needs: + - build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: bindings-aarch64-unknown-linux-musl + path: . + - name: List packages + run: ls -R . + shell: bash + - name: Install dependencies + run: | + yarn config set supportedArchitectures.cpu "arm64" + yarn config set supportedArchitectures.libc "musl" + yarn install + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests + uses: addnab/docker-run-action@v3 + with: + image: node:lts-alpine + options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' + run: | + set -e + yarn test universal-macOS: name: Build universal macOS binary needs: diff --git a/__test__/index.spec.mjs b/__test__/index.spec.mjs index 1a95748..283acd6 100644 --- a/__test__/index.spec.mjs +++ b/__test__/index.spec.mjs @@ -3,7 +3,7 @@ import test from 'ava' import { getCssModulesLocalIdent } from '../index.js' test('template [hash]', (t) => { - t.is(getCssModulesLocalIdent('src/pages/index.module.css', 'test' ,'[hash]'), '_58deea1c54f94c19c993'); + t.is(getCssModulesLocalIdent('src/pages/index.module.css', 'test' ,'[hash]'), 'c25864290c9e89ea1553'); }) test('template [path][name][ext]__[local]', (t) => { t.is(getCssModulesLocalIdent('src/pages/index.module.css', 'test' ,'[path][name][ext]__[local]'), 'src-pages-index-module-css__test');