Matcher: Status API #341
Workflow file for this run
This file contains hidden or 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: "Front (Web)" | |
on: | |
pull_request: | |
branches: [ main ] | |
push: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
defaults: | |
run: | |
working-directory: ./front/apps/web | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
front: ${{ steps.filter.outputs.front }} | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
front: | |
- 'front/apps/web/**' | |
- 'front/package.json' | |
- 'front/translations/**' | |
- 'front/packages/**' | |
- '.github/workflows/front-web.yml' | |
- '.github/actions/cache-front/**' | |
- '.github/actions/dockerize/**' | |
Build: | |
needs: changes | |
if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Restore Dependencies | |
uses: ./.github/actions/cache-front | |
- name: Install Dependencies | |
run: yarn install | |
- name: Build | |
run: yarn build:web | |
Biome: | |
if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
needs: [ Build ] | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Restore Dependencies | |
uses: ./.github/actions/cache-front | |
- name: Install Dependencies | |
run: yarn install | |
- name: Run Linter | |
run: yarn run -T biome ci . ../../packages | |
Analysis: | |
needs: [ Build ] | |
name: "Static Analysis" | |
runs-on: ubuntu-latest | |
if: ${{ needs.changes.outputs.front == 'true' && always() }} | |
steps: | |
- uses: actions/checkout@v3 | |
# - name: Downlad Coverage artifact | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: coverage-report-front | |
# path: ./front/coverage | |
- name: Run SonarCloud Scan | |
uses: SonarSource/sonarqube-scan-action@master | |
with: | |
projectBaseDir: ./front | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONT }} | |
Dockerize: | |
runs-on: ubuntu-latest | |
needs: changes | |
if: ${{ github.event_name == 'release' || (needs.changes.outputs.front == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }} | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- uses: ./.github/actions/dockerize | |
with: | |
docker-username: ${{ secrets.DOCKERHUB_USERNAME }} | |
docker-token: ${{ secrets.DOCKERHUB_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
context: ./front | |
image-suffix: front | |
publish: ${{ github.event_name == 'release' || (needs.changes.outputs.front == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') }} | |
# Tests: | |
# runs-on: ubuntu-latest | |
# needs: [ Build ] | |
# if: ${{ needs.changes.outputs.front == 'true' && always() }} | |
# steps: | |
# - name: Check out the repo | |
# uses: actions/checkout@v3 | |
# - name: Restore Dependencies | |
# uses: ./.github/actions/cache-front | |
# - name: Install Dependencies | |
# run: yarn install | |
# - name: Run unit tests with coverage | |
# run: yarn test:cov | |
# - name: Upload Unit Tests artifact | |
# if: ${{ always() }} | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: coverage-report-front | |
# path: ./front/coverage |