diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 418504e..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: 2 - -# Set defaults to reuse -defaults: &defaults - working_directory: ~/repo - docker: - - image: circleci/node:8.10.0 - -jobs: - test: - <<: *defaults - steps: - - checkout - - - restore_cache: - keys: - - v2-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v2-dependencies- - - - run: npm install - - run: - name: Run tests - command: npm test - - run: - name: Send to Coveralls - command: cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - - save_cache: - paths: - - node_modules - key: v2-dependencies-{{ checksum "package.json" }} - - - persist_to_workspace: - root: ~/repo - paths: . - -workflows: - version: 2 - test-deploy: - jobs: - - test: - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ee22447 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: ['**'] + tags: ['**'] + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + test: + name: Test (Node ${{ matrix.node-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [18, 20] + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Upload coverage to Coveralls + if: success() && matrix.node-version == 20 + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage/lcov.info + continue-on-error: true diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bf5641b..71bb0b1 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,26 +1,37 @@ -on: push name: Deploy to GitHub Pages + +on: + push: + branches: [master] + jobs: - filterBranch: - name: Filter branch + deploy-docs: + name: Deploy docs runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@master - - name: Filter branch - uses: actions/bin/filter@master - with: - args: branch master - - name: Install - uses: actions/npm@master - with: - args: install --prefix ./website - - name: Update version - uses: clay/docusaurus-github-action@master - with: - args: version - - name: Build and push docs - uses: clay/docusaurus-github-action@master - env: - DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} - with: - args: deploy + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '16' + + - name: Install website dependencies + run: npm install + working-directory: website + + - name: Update Docusaurus version + uses: clay/docusaurus-github-action@f3ea5271a51c1f06e456d55e490993985210c02b + with: + args: version + + - name: Build and publish to gh-pages + uses: clay/docusaurus-github-action@f3ea5271a51c1f06e456d55e490993985210c02b + env: + DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} + with: + args: deploy