diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5f3cc7fd..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2.1 -executors: - node18: - docker: - - image: cimg/node:18.19 - -orbs: - browser-tools: circleci/browser-tools@1.4.6 - codecov: codecov/codecov@3.3.0 - -commands: - setup: - steps: - - checkout - - run: - name: Installing Dependencies - command: npm ci - - run: - name: prepare test git user - command: git config --global user.email "circleci@example.com" && git config --global user.name "CircleCi Build" - -jobs: - build: - executor: node18 - steps: - - setup - - run: mkdir junit - - run: - name: Lint - command: npm run lint - - browser-tools/install-chrome - - run: - name: Test - command: | - export CHROME_PATH=`find /home/circleci/project/node_modules -name chrome` - npm run test-ci - - codecov/upload - - store_test_results: - path: junit - - store_artifacts: - path: junit - -workflows: - version: 2 - build: - jobs: - - build diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..eca50ac5 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,33 @@ +name: Build +on: [push] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm run lint + - run: npm test + + release: + name: Release + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm run semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml deleted file mode 100644 index f39db976..00000000 --- a/.github/workflows/semantic-release.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Semantic Release -on: - push: - branches: - - 'main' - -jobs: - build: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v4 - with: - node-version: '18.x' - - run: npm install - - run: npm test - - run: npm run semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} diff --git a/package.json b/package.json index 60f33bf6..f96880d5 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "test:web": "web-test-runner test/browser/*.test.js --node-resolve", "test:web:watch": "web-test-runner test/browser/*.test.js --node-resolve --watch", "test": "c8 mocha && npm run test:web", - "test-ci": "c8 mocha && npm run test:web", "semantic-release": "semantic-release", "prepare": "npx husky install" },