-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(common): add main branch pipeline
- Loading branch information
1 parent
c81a3bb
commit 5f15462
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |