Skip to content

Update main.yaml

Update main.yaml #4557

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop, 'feature/**']
jobs:
tests:
runs-on: ubuntu-latest
steps:
# Checkout the Repo
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Install Node 18
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name : Npm Install
run: npm install
- name : Lint
run : npm run lint
- name : Test
run: npm test
- name : Check Path
run: ls -la && pwd && ls -la /
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: success() || failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Test_Docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Set up Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Use Buildx with caching
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# Build with caching
- name: Build Docker Compose services
run: |
docker-compose -f ./compose.yaml build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache
# Run Docker Compose
- name: Test Docker Compose
uses: isbang/[email protected]
with:
compose-file: "./compose.yaml"
up-flags: "-d"