From bf25a6811b268ed9456fc84162082c76e361b57f Mon Sep 17 00:00:00 2001 From: Emil Balitzki Date: Mon, 6 May 2024 16:34:54 +0200 Subject: [PATCH] Added GitHub Actions for linting Signed-off-by: Emil Balitzki --- .../{backend-tests.yml => backend-CI.yml} | 2 +- .github/workflows/build.yml | 4 +-- ...loy_prod_env.yml => deploy_production.yml} | 12 +++---- .../{deploy_test_env.yml => deploy_test.yml} | 10 +++--- .github/workflows/frontend-CI.yml | 32 +++++++++++++++++++ .github/workflows/frontend-tests.yml | 27 ---------------- 6 files changed, 46 insertions(+), 41 deletions(-) rename .github/workflows/{backend-tests.yml => backend-CI.yml} (94%) rename .github/workflows/{deploy_prod_env.yml => deploy_production.yml} (83%) rename .github/workflows/{deploy_test_env.yml => deploy_test.yml} (88%) create mode 100644 .github/workflows/frontend-CI.yml delete mode 100644 .github/workflows/frontend-tests.yml diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-CI.yml similarity index 94% rename from .github/workflows/backend-tests.yml rename to .github/workflows/backend-CI.yml index 7a9a138d..99ad01cb 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-CI.yml @@ -1,4 +1,4 @@ -name: Backend - Tests +name: Backend - CI on: pull_request: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e721ea9d..7187101d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,10 @@ on: jobs: build: - name: Build the Docker Image + name: Build Images runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Build Image + - name: Build Images run: docker compose build --pull diff --git a/.github/workflows/deploy_prod_env.yml b/.github/workflows/deploy_production.yml similarity index 83% rename from .github/workflows/deploy_prod_env.yml rename to .github/workflows/deploy_production.yml index f0bd70ce..1972cf8b 100644 --- a/.github/workflows/deploy_prod_env.yml +++ b/.github/workflows/deploy_production.yml @@ -1,4 +1,4 @@ -name: Deploy Production Service +name: Deploy - Production Env. on: push: @@ -6,8 +6,8 @@ on: - main jobs: - publish: - name: Publish Docker Image + PublishImages: + name: Publish Docker Images runs-on: ubuntu-latest steps: @@ -22,9 +22,9 @@ jobs: - name: Logout run: docker logout - deploy: - needs: publish - name: Deploy Image on the Server + DeployProductionEnv: + needs: PublishImages + name: Deploy Image in the Production Environment runs-on: ubuntu-latest steps: diff --git a/.github/workflows/deploy_test_env.yml b/.github/workflows/deploy_test.yml similarity index 88% rename from .github/workflows/deploy_test_env.yml rename to .github/workflows/deploy_test.yml index db397385..b6238b16 100644 --- a/.github/workflows/deploy_test_env.yml +++ b/.github/workflows/deploy_test.yml @@ -1,4 +1,4 @@ -name: Deploy Test Service +name: Deploy - Test Env. on: push: @@ -6,7 +6,7 @@ on: - sprint-release jobs: - publish: + PublishImages: name: Publish Docker Image runs-on: ubuntu-latest @@ -22,9 +22,9 @@ jobs: - name: Logout run: docker logout - deploy: - needs: publish - name: Deploy Image on the Server + DeployTestEnv: + needs: PublishImages + name: Deploy Image in the Test Environment runs-on: ubuntu-latest steps: diff --git a/.github/workflows/frontend-CI.yml b/.github/workflows/frontend-CI.yml new file mode 100644 index 00000000..7b247076 --- /dev/null +++ b/.github/workflows/frontend-CI.yml @@ -0,0 +1,32 @@ +name: Frontend - CI + +on: + pull_request: + branches: + - sprint-release + - main + paths: + - "frontend/**" + +jobs: + RunChecks: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + + - name: Setup frontend + run: npm ci + working-directory: frontend + + - name: Run linting checks + run: npm run lint + working-directory: frontend diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml deleted file mode 100644 index 30a0dffb..00000000 --- a/.github/workflows/frontend-tests.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Frontend - Tests - -on: - pull_request: - branches: - - sprint-release - - main - paths: - - "frontend/**" - -jobs: - linting: - name: Check linting - runs-on: ubuntu-latest - - steps: - - name: Echo Linting - run: echo "linting" - - tests: - needs: linting - name: Run Tests - runs-on: ubuntu-latest - - steps: - - name: Echo Test - run: echo "test"