Merge pull request #37 from waldiez/dev #81
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
--- | |
name: Lint, test, and docs | |
# yamllint disable rule:truthy | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
# yarn: latest / berry / stable | |
- run: | | |
corepack enable | |
yarn set version stable | |
- name: Install dependencies | |
run: yarn install | |
- name: Lint | |
run: yarn lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: | | |
corepack enable | |
yarn set version stable | |
- name: Install dependencies | |
run: yarn install | |
- name: Prepare Playwright | |
run: npx playwright install --with-deps chromium | |
- name: Run tests | |
run: yarn test:all | |
- name: Report to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: coverage/lcov.info | |
docs: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: | | |
corepack enable | |
yarn set version stable | |
- name: Install dependencies | |
run: yarn install | |
- name: Build docs | |
run: yarn docs | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: './out/docs' | |
deploy-docs: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: docs | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |