This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
chore(deps): update actions/upload-artifact action to v4 #211
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" | |
workflow_dispatch: | |
jobs: | |
dependency-review: | |
name: Vulnerable dependencies π | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Scan | |
uses: actions/dependency-review-action@v3.1.4 | |
lint_frontend: | |
name: Lint (frontend) π¬ | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- name: Checkout β¬οΈ | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Setup node environment βοΈ | |
uses: actions/setup-node@v4.0.0 | |
with: | |
node-version: 20 | |
check-latest: true | |
- name: Install dependencies π¦ | |
run: npm ci --no-audit | |
- name: Run linter βοΈ | |
run: npm run lint | |
typecheck_frontend: | |
name: Typecheck (frontend) π― | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- name: Checkout β¬οΈ | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Setup node environment βοΈ | |
uses: actions/setup-node@v4.0.0 | |
with: | |
node-version: 20 | |
check-latest: true | |
- name: Install dependencies π¦ | |
run: npm ci --no-audit | |
- name: Run typecheck π | |
run: npm run typecheck | |
build_frontend: | |
name: Build (frontend) ποΈ | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- name: Checkout β¬οΈ | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Setup node environment βοΈ | |
uses: actions/setup-node@v4.0.0 | |
with: | |
node-version: 20 | |
check-latest: true | |
- name: Install dependencies π¦ | |
run: npm ci --no-audit | |
- name: Run build βοΈ | |
run: npm run build | |
conventional_commits: | |
name: Conventional commits check π¬ | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout β¬οΈ | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Check if all commits comply with the specification | |
uses: webiny/action-conventional-commits@v1.2.0 | |
run_backend: | |
name: Run backend πββοΈ | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: backend | |
steps: | |
- name: Checkout β¬οΈ | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Setup Python π | |
uses: actions/setup-python@v5.0.0 | |
with: | |
python-version: '3.x' | |
check-latest: true | |
- name: Install dependencies π¦ | |
run: pip install -r requirements.txt | |
- name: Perform migrations ποΈ | |
run: python ./manage.py migrate | |
- name: Run Django Server πββοΈ | |
run: | | |
python manage.py runserver & | |
sleep 10 # Espera a que el servidor estΓ© listo | |
- name: Check server π©Ί | |
run: | | |
curl -I http://127.0.0.1:8000/ | |
sudo pkill python | |
test_backend: | |
name: Test backend π | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: backend | |
steps: | |
- name: Checkout β¬οΈ | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Setup Python π | |
uses: actions/setup-python@v5.0.0 | |
with: | |
python-version: '3.x' | |
check-latest: true | |
- name: Install dependencies π¦ | |
run: pip install -r requirements.txt | |
- name: Perform tests βοΈ | |
run: python ./manage.py test | |
build: | |
name: Build Docker image π¦ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout β¬οΈ | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- name: Configure QEMU βοΈ | |
uses: docker/setup-qemu-action@v3.0.0 | |
- name: Configure Docker Buildx βοΈ | |
uses: docker/setup-buildx-action@v3.0.0 | |
- name: Build Docker images π οΈ | |
uses: docker/build-push-action@v5.1.0 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64 | |
load: true | |
tags: | | |
traineerbook | |
- name: Extract Docker image for artifact publishing π¦ | |
run: | | |
docker save traineerbook > docker_image.tar.gz | |
- name: Upload artifact (Docker image) β¬οΈπ¦ | |
uses: actions/upload-artifact@v4.0.0 | |
with: | |
name: docker_image | |
path: | | |
docker_image.tar.gz |