diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c500a73..b27ee9d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,13 +1,13 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs -name: Node CI +name: Node PR checks on: - push: - branches: ["main"] pull_request: branches: ["main"] + paths: + - src/**/* jobs: build: diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..ca282d8 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,47 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy test coverage to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + - run: pnpm install + - run: pnpm test + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: "./coverage" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/package.json b/package.json index 774564f..6b38fcf 100644 --- a/package.json +++ b/package.json @@ -68,5 +68,8 @@ "bugs": { "url": "https://github.com/simonespa/algorithms-and-data-structures/issues" }, - "homepage": "https://github.com/simonespa/algorithms-and-data-structures#readme" + "homepage": "https://github.com/simonespa/algorithms-and-data-structures#readme", + "dependencies": { + "algorithms-and-data-structures": "link:" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 10825ff..3a19c33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,10 @@ settings: importers: .: + dependencies: + algorithms-and-data-structures: + specifier: 'link:' + version: 'link:' devDependencies: '@eslint/js': specifier: ^9.31.0