From fd70ea04e6d7821972d570dc805d31f9eea0b632 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Sat, 18 Sep 2021 15:29:28 +0700 Subject: [PATCH] chore: fix github actions --- .github/workflows/release.yml | 39 ----------------------------- .github/workflows/test.yml | 46 +++++++++++++++++------------------ 2 files changed, 23 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4cca234..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Publish Package - -on: - push: - tags: - - 'v*' - -jobs: - publish-npm: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Use Node.js 14.x - uses: actions/setup-node@v2 - with: - node-version: '14.x' - registry-url: https://registry.npmjs.org/ - - - name: Install dependencies - run: | - npm i -g pnpm @antfu/ni - nci - - - name: Run test - run: nr test --if-present - - - name: Publish package - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: GitHub Release - run: npx conventional-github-releaser -p angular - env: - CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f06571..d1bafa3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,38 +6,38 @@ on: jobs: test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - node: [12, 14, 16] + runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node }} + - name: Use Node.js uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node }} - registry-url: https://registry.npmjs.org/ + node-version: 16 - - name: Setup cache - uses: actions/cache@v2 - id: pnpm-cache + - name: Install dependencies + run: npm install + + - name: ESLint Check + run: npx eslint --ext .js,.ts --ignore-path .gitignore . + + - name: Prettier Check + run: npx prettier --check --ignore-path .gitignore . + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 with: - path: ${{ (runner.os == 'Windows' && 'D:\.pnpm-store') || '~/.pnpm-store' }} - key: ${{ runner.os }}-${{ matrix.node }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.node }}-pnpm- + languages: javascript - - name: Install dependencies - run: | - npm i -g pnpm @antfu/ni - nci + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 + + - name: Build Test + run: npm run build - - name: Run test - run: nr test --if-present + - name: Test + run: npm run test - - name: Run build - run: nr build + - uses: codecov/codecov-action@v2