diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index b3d9b61d..ffa99868 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -1,9 +1,13 @@ -name: Check build on various systems and node versions +name: CI on: push: + paths-ignore: + - "docs/**" branches: main pull_request: + paths-ignore: + - "docs/**" branches: main jobs: @@ -11,48 +15,124 @@ jobs: runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - node-version: [16.x, 18.x] + os: [ubuntu-latest, windows-latest] + node: [16] + + timeout-minutes: 10 - name: Node ${{ matrix.node-version }} on ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: Install pnpm - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v3 + - run: corepack enable + - uses: actions/setup-node@v3 with: - version: 7 - run_install: false - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - name: Setup pnpm cache + node-version: ${{ matrix.node }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build ANU + run: pnpm build + + - name: Cache dist uses: actions/cache@v3 with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + path: packages/*/dist + key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }} + + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [16] + + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v3 + - run: corepack enable + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: "pnpm" + - name: Install dependencies run: pnpm install - - name: Build anu - run: pnpm run build + - name: Run unit tests - run: npm run test -- --reporter=junit --outputFile=../../test-results.xml + run: pnpm run --filter=anu-vue test --reporter=junit --outputFile=../../test-results.xml + - name: Add tests results to artifacts uses: actions/upload-artifact@v2 if: always() with: - name: test-results-${{ runner.os }}-${{ matrix.node-version }} + name: test-results-${{ runner.os }}-${{ matrix.node }} path: test-results.xml + + lint: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [16] + + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v3 + - run: corepack enable + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Lint + run: pnpm lint + + build-release: + if: | + github.event_name == 'push' && + !contains(github.event.head_commit.message, '[skip-release]') && + !contains(github.event.head_commit.message, 'chore') && + !contains(github.event.head_commit.message, 'docs') + needs: + - build + - test + - lint + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [16] + + timeout-minutes: 20 + + steps: + - uses: actions/checkout@v3 + - run: corepack enable + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Restore dist cache + uses: actions/cache@v3 + with: + path: packages/*/dist + key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }} + + - name: Release Edge + run: ./scripts/release-edge.sh + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 86181dc0..265b5eec 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@typescript-eslint/parser": "^5.47.0", "@vue-macros/volar": "^0.5.6", "bumpp": "^8.2.1", + "defu": "^6.1.1", "eslint": "^8.30.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-import-resolver-typescript": "^3.5.2", @@ -38,8 +39,11 @@ "fast-glob": "^3.2.12", "fs-extra": "^11.1.0", "globby": "^13.1.3", + "jiti": "^1.16.0", + "pathe": "^1.0.0", "pnpm": "^7.19.0", "rimraf": "^3.0.2", + "semver": "^7.3.8", "taze": "^0.8.5", "tsx": "^3.12.1", "typescript": "^4.9.4", diff --git a/packages/anu-vue/src/components/alert/AAlert.vue b/packages/anu-vue/src/components/alert/AAlert.vue index d220f8e9..c9b1f67f 100644 --- a/packages/anu-vue/src/components/alert/AAlert.vue +++ b/packages/anu-vue/src/components/alert/AAlert.vue @@ -1,9 +1,9 @@