This repository was archived by the owner on Jun 10, 2024. It is now read-only.
chore(deps): update npm development dependencies #941
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: Quality checks 👌🧪 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
paths-ignore: | |
- "**/*.md" | |
merge_group: | |
schedule: | |
- cron: "30 7 * * 6" | |
workflow_dispatch: | |
jobs: | |
dependency-review: | |
name: Vulnerable dependencies 🔎 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4.1.4 | |
with: | |
show-progress: false | |
submodules: recursive | |
- name: Scan | |
uses: actions/dependency-review-action@v4.3.2 | |
with: | |
## Workaround from https://github.com/actions/dependency-review-action/issues/456 | |
## TODO: Remove when necessary | |
base-ref: ${{ github.event.pull_request.base.sha || 'master' }} | |
head-ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
lint: | |
name: Lint 🔬 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/checkout@v4.1.4 | |
with: | |
show-progress: false | |
submodules: recursive | |
- name: Setup node environment ⚙️ | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: 20 | |
check-latest: true | |
- name: Install dependencies 📦 | |
run: npm ci --no-audit | |
- name: Run linter ✏️ | |
run: npm run lint | |
typecheck: | |
name: Typecheck 🈯 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/checkout@v4.1.4 | |
with: | |
show-progress: false | |
submodules: recursive | |
- name: Setup node environment ⚙️ | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: 20 | |
check-latest: true | |
- name: Install dependencies 📦 | |
run: npm ci --no-audit | |
- name: Run typecheck 📖 | |
run: npm run typecheck | |
test: | |
name: Test 🔬 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/checkout@v4.1.4 | |
with: | |
show-progress: false | |
submodules: recursive | |
- name: Setup node environment ⚙️ | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: 20 | |
check-latest: true | |
- name: Install dependencies 📦 | |
run: npm ci --no-audit | |
- name: Run tests 🧪 | |
run: npm run test | |
build: | |
name: Build frontend 🛠️ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/checkout@v4.1.4 | |
with: | |
show-progress: false | |
submodules: recursive | |
- name: Configure Docker Buildx ⚙️ | |
uses: docker/setup-buildx-action@v3.3.0 | |
- name: Build Docker images 🛠️ | |
uses: docker/build-push-action@v5.3.0 | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
load: true | |
tags: | | |
ispp-2424-ocial/frontend:pr-build | |
- name: Extract built client and Docker image for artifact publishing 📦 | |
run: | | |
docker save ispp-2424-ocial/frontend:pr-build > docker_image.tar | |
docker cp $(docker create --name ocial ispp-2424-ocial/frontend:pr-build):/usr/share/nginx/html/ ./dist | |
docker rm ocial | |
- name: Upload artifact (Docker image) ⬆️📦 | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
compression-level: 0 | |
name: docker_image | |
path: | | |
docker_image.tar | |
- name: Upload artifact (Client) ⬆️💻 | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
compression-level: 0 | |
name: frontend | |
path: | | |
dist | |
pr_context: | |
name: Save PR context as artifact | |
if: ${{ always() && !cancelled() && github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
needs: | |
- dependency-review | |
- lint | |
- typecheck | |
- build | |
- test | |
steps: | |
- name: Save PR context | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
PR_SHA: ${{ github.sha }} | |
run: | | |
echo $PR_NUMBER > PR_number | |
echo $PR_SHA > PR_sha | |
- name: Upload PR number as artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
compression-level: 0 | |
name: PR_context | |
path: | | |
PR_number | |
PR_sha | |
conventional_commits: | |
name: Conventional commits check 💬 | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/checkout@v4.1.4 | |
with: | |
show-progress: false | |
submodules: recursive | |
- name: Check if all commits comply with the specification | |
uses: webiny/action-conventional-commits@v1.3.0 | |
no_merge_commits: | |
name: No merge commits check 🚫 | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/checkout@v4.1.4 | |
with: | |
show-progress: false | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Check commits | |
uses: greenled/no-merge-commits-check@v1.0.1 |