Correctly handle HTTP errors with GitHub API #478
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: Draw.io Plugin CI | |
on: | |
push: | |
paths: | |
- '.github/workflows/node.js.yml' | |
- 'docker/**' | |
- 'src/**' | |
- 'package-lock.json' | |
- 'package.json' | |
- '**.ts' | |
- '**.js' | |
pull_request: | |
paths: | |
- '.github/workflows/node.js.yml' | |
- 'docker/**' | |
- 'src/**' | |
- 'package-lock.json' | |
- 'package.json' | |
- '**.ts' | |
- '**.js' | |
jobs: | |
# https://github.com/orgs/community/discussions/27031#discussioncomment-3254376 | |
pre_job: | |
name: Check duplicate | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
skip_after_successful_duplicate: 'true' | |
concurrent_skipping: 'same_content_newer' | |
build: | |
name: Build Draw.io Plugin | |
runs-on: ubuntu-latest | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run build --if-present | |
- run: npm run lint | |
- name: Install Playwright | |
run: npx playwright install --with-deps | |
- name: Create Docker image for Draw.io webserver | |
run: npm run docker | |
- name: Start draw.io webserver | |
run: npm run start | |
- name: Run Playwright tests | |
run: npm run test | |
- name: Archive Playwright test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-test-results | |
path: test-results/ | |
- name: Stop webserver | |
if: always() | |
run: npm run stop | |
- name: Archive compiled plugin | |
uses: actions/upload-artifact@v4 | |
with: | |
name: plugin | |
path: dist/attackgraphs.js |