diff --git a/.github/workflows/ci-branch.yml b/.github/workflows/ci-branch.yml new file mode 100644 index 00000000..c717647f --- /dev/null +++ b/.github/workflows/ci-branch.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + branches: + - develop + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + +permissions: + contents: read + +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..a124f2e1 --- /dev/null +++ b/.github/workflows/ci-pull-request.yml @@ -0,0 +1,19 @@ +name: CI + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + +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..764c8b40 --- /dev/null +++ b/.github/workflows/ci-reusable.yml @@ -0,0 +1,55 @@ +name: CI Pipeline + +on: + workflow_call: + inputs: + checkout-ref: + description: 'Git ref to checkout (empty for default merge commit)' + type: string + required: false + default: '' + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ['lts/*', '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: Clone and setup Enact CLI + run: | + git clone --branch=release/7.2.x.develop --depth 1 https://github.com/enactjs/cli ../cli + pushd ../cli + npm install + npm link + popd + + - name: Install project dependencies + run: npm install --legacy-peer-deps + + - name: Run ESLint + run: npm run lint -- --report-unused-disable-directives --max-warnings 0 . + + - name: Parsing docs + run: npm run parse + + - name: Building sample runner + run: npm run make-runner + + - name: Generating docs + run: npm run build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 82c83c23..00000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -dist: focal -language: node_js -node_js: - - lts/* - - "22" -sudo: false -install: - - npm config set prefer-offline false - - git clone --branch=develop --depth 1 https://github.com/enactjs/cli ../cli - - pushd ../cli - - npm install - - npm link - - popd - - npm install --legacy-peer-deps -script: - - echo -e "\x1b\x5b35;1m*** Linting docs...\x1b\x5b0m" - - npm run lint -- --report-unused-disable-directives --max-warnings 0 . - - echo -e "\x1b\x5b35;1m*** Linting complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Parsing docs...\x1b\x5b0m" - - npm run parse - - echo -e "\x1b\x5b35;1m*** Parsing complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Building sample runner...\x1b\x5b0m" - - npm run make-runner - - echo -e "\x1b\x5b35;1m*** Building sampler runner complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Generating docs...\x1b\x5b0m" - - npm run build - - echo -e "\x1b\x5b35;1m*** Doc generation complete\x1b\x5b0m"