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..7209b41d --- /dev/null +++ b/.github/workflows/ci-reusable.yml @@ -0,0 +1,78 @@ +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: ['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=develop --depth 1 https://github.com/enactjs/cli ../cli + pushd ../cli + npm install + npm link + popd + + - name: Install project dependencies + run: npm install + + - name: Run ESLint + run: npm run lint + + - name: Starting agate/all-samples build + run: | + cd agate/all-samples + npm install + npm run pack + cd ../../ + + - name: Starting moonstone/all-samples build + run: | + cd moonstone/all-samples + npm install + npm run pack + cd ../../ + + - name: Starting sandstone/all-samples build + run: | + cd sandstone/all-samples + npm install + npm run pack + cd ../../ + + - name: Starting ui/all-samples build + run: | + cd ui/all-samples + npm install + npm run pack + cd ../../ + + - name: Starting my-theme-app build + run: | + cd my-theme-app + npm install + npm run pack + cd ../../ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fd77a8bd..00000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -dist: jammy -language: node_js -node_js: - - lts/* - - node -sudo: false -install: - - git clone --branch=develop --depth 1 https://github.com/enactjs/cli ../cli - - pushd ../cli - - npm install - - npm link - - popd - - npm install -script: - - echo -e "\x1b\x5b35;1m*** Starting eslint...\x1b\x5b0m" - - rm tutorial-typescript -rf # Skip the test until CLI fixed the related issue(WRO-521) - - npm run lint - - echo -e "\x1b\x5b35;1m*** eslint complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Starting agate/all-samples build...\x1b\x5b0m" - - cd agate/all-samples - - npm install - - npm run pack - - cd ../../ - - echo -e "\x1b\x5b35;1m*** agate/all-samples build complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Starting moonstone/all-samples build...\x1b\x5b0m" - - cd moonstone/all-samples - - npm install - - npm run pack - - cd ../../ - - echo -e "\x1b\x5b35;1m*** moonstone/all-samples build complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Starting sandstone/all-samples build...\x1b\x5b0m" - - cd sandstone/all-samples - - npm install - - npm run pack - - cd ../../ - - echo -e "\x1b\x5b35;1m*** sandstone/all-samples build complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Starting ui/all-samples build...\x1b\x5b0m" - - cd ui/all-samples - - npm install - - npm run pack - - cd ../../ - - echo -e "\x1b\x5b35;1m*** ui/all-samples build complete\x1b\x5b0m" - - echo -e "\x1b\x5b35;1m*** Starting my-theme-app build...\x1b\x5b0m" - - cd my-theme-app - - npm install - - npm run pack - - cd ../../ - - echo -e "\x1b\x5b35;1m*** my-theme-app build complete\x1b\x5b0m"