diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..5e2e8ddf2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI +on: [push, pull_request] +jobs: + build: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + steps: + - run: git config --global core.autocrlf input + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v2 + with: + node-version: '12' + cache: 'yarn' + + - run: yarn install + - run: yarn lint + - run: yarn flow + - run: yarn test --coverage + - run: yarn build + - run: yarn run bundlesize + - run: yarn esdoc + + - name: Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + if: ${{ matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main' }} + run: yarn coveralls + shell: bash + + - name: Publish to Chromatic + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: chromaui/action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + autoAcceptChanges: main + exitZeroOnChanges: true + exitOnceUploaded: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index df80f47fa..000000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: node_js -node_js: -- 12 -os: -- linux -- osx -- windows -cache: - directories: - - node_modules -git: - autocrlf: input -branches: - only: - - main -script: -- yarn lint -- yarn flow -- flow stop -- yarn test --coverage -- yarn build -- yarn run bundlesize -- yarn esdoc && mv docs/ build/ -- gpgconf --kill gpg-agent -after_script: -- if [ "x$TRAVIS_OS_NAME" = "xlinux" -a "x$TRAVIS_BRANCH" = "xmain" ]; then - yarn coveralls; - else true; fi -- if [ "x$TRAVIS_OS_NAME" = "xlinux" ]; then - yarn snapshot; - - if [[ $TRAVIS_EVENT_TYPE != "pull_request" || $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]]; then - if [ "x$TRAVIS_BRANCH" = "xmain" ]; then - yarn chromatic --auto-accept-changes --exit-once-uploaded; - else - yarn chromatic --exit-zero-on-changes --exit-once-uploaded; - fi - fi - fi