diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f9d11c9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,58 @@ +name: PR +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 \ No newline at end of file