diff --git a/.github/workflows/ci-branch.yml b/.github/workflows/ci-branch.yml new file mode 100644 index 00000000..e1fd79a7 --- /dev/null +++ b/.github/workflows/ci-branch.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + branches: + - develop + - master + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + +concurrency: + group: ci-branch-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + branch: + uses: ./.github/workflows/ci-reusable.yml + with: + checkout-ref: ${{ github.event.pull_request.head.sha || github.sha }} + secrets: inherit diff --git a/.github/workflows/ci-pull-request.yml b/.github/workflows/ci-pull-request.yml new file mode 100644 index 00000000..9ab1857a --- /dev/null +++ b/.github/workflows/ci-pull-request.yml @@ -0,0 +1,16 @@ +name: CI + +on: + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ci-pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + pull-request: + uses: ./.github/workflows/ci-reusable.yml + with: + checkout-ref: '' + secrets: inherit diff --git a/.github/workflows/ci-reusable.yml b/.github/workflows/ci-reusable.yml new file mode 100644 index 00000000..381867fa --- /dev/null +++ b/.github/workflows/ci-reusable.yml @@ -0,0 +1,38 @@ +name: CI Pipeline + +on: + workflow_call: + inputs: + checkout-ref: + description: 'Git ref to checkout (empty for default merge commit)' + type: string + required: false + default: '' + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ['node'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.checkout-ref || github.ref }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Install project dependencies + run: | + npm install + npm link + + - name: Run ESLint + run: | + npm run lint -- -- --report-unused-disable-directives --max-warnings 0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f893d5dd..00000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -dist: focal -language: node_js -node_js: - - node -sudo: false -install: - - npm config set prefer-offline false - - npm install - - npm link - -script: - - npm run lint -- --report-unused-disable-directives --max-warnings 0 diff --git a/config/webpack.config.js b/config/webpack.config.js index 238f4061..1714bc2a 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -331,7 +331,6 @@ module.exports = function ( store: 'pack', buildDependencies: { defaultWebpack: ['webpack/lib/'], - // eslint-disable-next-line no-undef config: [__filename], tsconfig: useTypeScript ? ['tsconfig.json'] : [] }