diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 000000000..e5b1ea6e7 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,5 @@ +name: "CodeQL config" + +paths-ignore: + - docs/assets/plugins/ + - plugins/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..9dd17b29f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +name: CI + +on: + push: + branches: + - master + - v4-dev + pull_request: + branches: + - "**" + +env: + FORCE_COLOR: 2 + +jobs: + run: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node: + - "14.x" + - "16.x" + - "18.x" + os: + - "ubuntu-latest" + - "macos-latest" + - "windows-latest" + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - name: Get npm cache directory + id: npm-cache + run: | + echo "::set-output name=dir::$(npm config get cache)" + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} + restore-keys: | + ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} + ${{ runner.os }}-node-v${{ matrix.node }}- + + - name: Install npm dependencies + run: npm ci + + - name: Build files + run: npm run compile + + - name: Run bundlewatch + run: npm run bundlewatch + if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '16') + env: + BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..2faf44c1e --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,35 @@ +name: "CodeQL" + +on: + push: + branches: + - master + - "!dependabot/**" + pull_request: + # The branches below must be a subset of the branches above + branches: + - master + schedule: + - cron: "0 0 * * 0" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: "javascript" + config-file: ./.github/codeql/codeql-config.yml + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..a518fc460 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,42 @@ +name: Lint + +on: + push: + branches: + - master + - v4-dev + pull_request: + branches: + - "**" + +env: + FORCE_COLOR: 2 + NODE: 18.x + +jobs: + run: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "${{ env.NODE }}" + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} + restore-keys: | + ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} + ${{ runner.os }}-node-v${{ env.NODE }}- + + - name: Install npm dependencies + run: npm ci + + - name: Run lint + run: npm run lint \ No newline at end of file