Skip to content

ci(common): add main branch pipeline #2

ci(common): add main branch pipeline

ci(common): add main branch pipeline #2

Workflow file for this run

name: main
on:
push:
branches: [main]
jobs:
main:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup variables
id: setup
run: |
cat package.json | grep "version" | sed 's/ "version": "\([^"]*\)",/\1/' >> .tmp-version
echo "VERSION=$(cat .tmp-version)" >> "$GITHUB_OUTPUT"
cat .tmp-version
rm .tmp-version
- name: Install dependencies
run: npm ci
- name: Code style
run: |
npm run lint
npm run prettier
- name: Unit Tests
run: npm test
# TODO: setup Playwright tests or remove this
# - name: Install Playwright Browsers
# run: npx playwright install --with-deps
# - name: Run Playwright tests
# run: npm run e2e
# - name: Keep test report
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 30
- name: Create release
if: always()
env:
VERSION: ${{ steps.setup.outputs.VERSION }}
run: |
npm run build
npm pack
- name: Keep release archive
uses: actions/upload-artifact@v4
if: always()
env:
VERSION: ${{ steps.setup.outputs.VERSION }}
with:
name: talk-control-revealjs-extensions-${{env.VERSION}}
path: talk-control-revealjs-extensions-${{env.VERSION}}.tgz
retention-days: 30