refactor(http): use node-fetch instead of axios in http plugin #276
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2024 Dyne.org foundation | |
# | |
# SPDX-License-Identifier: AGPL-3.0-or-later | |
name: π§ͺ Lint and test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
node: [ 20 ] | |
steps: | |
- name: ποΈ Checkout | |
uses: actions/checkout@v4 | |
- name: π¨ Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: β¬ Install dependencies | |
run: pnpm recursive install | |
- uses: supercharge/[email protected] | |
with: | |
redis-version: 6 | |
- name: Linting | |
continue-on-error: true | |
run: pnpm lint | |
- name: π€ Start pocketbase | |
run: ./pkg/pocketbase/test/pocketbase serve & | |
- name: π§ͺ Run the tests | |
run: pnpm coverage | |
- name: π¨ Setup playwright | |
run: | | |
npx playwright install | |
npx playwright install-deps | |
pnpm build | |
pnpm exec playwright test | |
working-directory: ./pkg/browser | |
build_docs: | |
runs-on: ubuntu-latest | |
needs: build_and_test | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: ποΈ Checkout | |
uses: actions/checkout@v4 | |
- name: π― Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v3 | |
name: π¨ Install pnpm | |
with: | |
version: 8 | |
- name: π Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: β¬ Install dependencies | |
run: pnpm install | |
- name: ποΈ update sentences tabled and build the docs | |
run: pnpm build && pnpm run docs | |
- name: β« Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/.vitepress/dist | |
deploy_docs: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build_docs | |
runs-on: ubuntu-latest | |
name: Deploy documentation | |
steps: | |
- name: π‘ Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
publish: | |
runs-on: ubuntu-latest | |
needs: build_and_test | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: ποΈ Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: π― Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
registry-url: 'https://registry.npmjs.org' | |
- name: π¨ Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: β¬ Install dependencies | |
run: pnpm i | |
- name: ποΈ Build all | |
run: pnpm build | |
- name: π Build @slangroom/browser | |
run: pnpm build | |
working-directory: ./pkg/browser | |
- name: π¦ Releases | |
run: | | |
git config --global user.email "[email protected]" && git config --global user.name "Dev Dyne.org" | |
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc | |
pnpm whoami | |
pnpm publish:ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |