diff --git a/.github/setup/action.yml b/.github/setup/action.yml index 44ddb4a5..fb6e267f 100644 --- a/.github/setup/action.yml +++ b/.github/setup/action.yml @@ -19,7 +19,7 @@ runs: - name: Read .nvmrc shell: bash id: nvm - run: echo "::set-output name=nvmrc::$(cat .nvmrc)" + run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Setup Node.js uses: actions/setup-node@v2 @@ -27,8 +27,14 @@ runs: node-version: ${{ steps.nvm.outputs.nvmrc }} cache: npm - - name: Setup branch for NX + - name: Setup branch for NX (main) shell: bash + if: github.ref == 'refs/head/main' + run: git branch -u origin/main main + + - name: Setup branch for NX (!main) + shell: bash + if: github.ref != 'refs/head/main' run: git branch --track main origin/main - name: Install without scripts 🔧 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 57a658ef..dbfa971e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ jobs: - name: Read .nvmrc id: nvm - run: echo ::set-output name=nvmrc::$(cat .nvmrc) + run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Setup Node.js uses: actions/setup-node@v2 diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 16c319d6..356f9fc9 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -55,7 +55,7 @@ jobs: uses: EnricoMi/publish-unit-test-result-action@v1 if: always() with: - files: junit/**/*.xml + files: coverage/**/*.junit.xml release: runs-on: ubuntu-latest @@ -64,6 +64,8 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} - uses: ./.github/setup diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ad8819f..8f546dce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} - uses: ./.github/setup diff --git a/nx.json b/nx.json index de91e7b1..a3577435 100644 --- a/nx.json +++ b/nx.json @@ -10,8 +10,9 @@ }, "targetDefaults": { "build": { - "dependsOn": ["prepare", "^build"], - "inputs": ["default", "^default", "baseTypescript"] + "dependsOn": ["^build"], + "inputs": ["default", "^default", "baseTypescript"], + "outputs": ["{projectRoot}/dist"] }, "test": { "dependsOn": ["^test"], diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json index 63bf256d..2467cd74 100644 --- a/packages/eslint-plugin/project.json +++ b/packages/eslint-plugin/project.json @@ -23,6 +23,8 @@ "executor": "@nx/vite:test", "outputs": ["{workspaceRoot}/coverage/packages/eslint-plugin"], "options": { + "coverage": true, + "reporters": ["junit"], "passWithNoTests": true, "reportsDirectory": "../../coverage/packages/eslint-plugin" } diff --git a/packages/eslint-plugin/vite.config.ts b/packages/eslint-plugin/vite.config.ts index feb3912e..036f1152 100644 --- a/packages/eslint-plugin/vite.config.ts +++ b/packages/eslint-plugin/vite.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ test: { globals: true, + outputFile: '../../coverage/packages/eslint-plugin/report.junit.xml', cache: { dir: '../../node_modules/.vitest', },