diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 66864cf..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,77 +0,0 @@ -version: 2 - -jobs: - lint: - docker: - - image: circleci/node:lts - steps: - - checkout - - restore_cache: - keys: - - node-modules-{{ checksum "package.json" }} - - node-modules- - - run: npm ci - - save_cache: - paths: - - node_modules - key: node-modules-{{ checksum "package.json" }} - - run: cd demo && npm ci && cd - - - run: npm run lint - - stylelint: - docker: - - image: circleci/node:lts - steps: - - checkout - - restore_cache: - keys: - - node-modules-{{ checksum "package.json" }} - - node-modules- - - run: npm ci - - save_cache: - paths: - - node_modules - key: node-modules-{{ checksum "package.json" }} - - run: npm run stylelint - - typescript: - docker: - - image: circleci/node:lts - steps: - - checkout - - restore_cache: - keys: - - node-modules-{{ checksum "package.json" }} - - node-modules- - - run: npm ci - - save_cache: - paths: - - node_modules - key: node-modules-{{ checksum "package.json" }} - - run: npm run types - - test: - docker: - - image: circleci/node:lts - steps: - - checkout - - restore_cache: - keys: - - node-modules-{{ checksum "package.json" }} - - node-modules- - - run: npm ci - - save_cache: - paths: - - node_modules - key: node-modules-{{ checksum "package.json" }} - - run: npm test -- --coverage - - run: bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage-final.json - -workflows: - version: 2 - build: - jobs: - - lint - - stylelint - - typescript - - test diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..1e9d1ad --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,47 @@ +on: [push] + +jobs: + cicd: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - uses: actions/cache@v3 + env: + cache-name: cache-node-modules-demo + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('demo/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - run: npm ci + - run: cd demo && npm ci && cd - + - run: npm run lint + - run: npm run types + - run: | + npm run test -- --coverage + bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage-final.json + + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + + #- uses: chromaui/action@v1 + # with: + # token: ${{ secrets.GITHUB_TOKEN }} + # projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + # exitOnceUploaded: true