Skip to content

Instantly share code, notes, and snippets.

@kavicastelo
Created July 13, 2024 21:12
Show Gist options
  • Save kavicastelo/532ec46392b1482a1c7562dc8677b7e8 to your computer and use it in GitHub Desktop.
Save kavicastelo/532ec46392b1482a1c7562dc8677b7e8 to your computer and use it in GitHub Desktop.
testing workflows for angualr and springboot projects
name: Test
on:
push:
branches:
- 'main'
jobs:
test-frontend:
if: contains(github.event.head_commit.message, '[run-all]')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create environment directory
run: mkdir -p client/src/environments
- name: Setup environment variables for production
run: echo "${{ secrets.ENV_FILE_PROD_CONTENT }}" > client/src/environments/environment.ts
- name: Setup environment variables for development
run: echo "${{ secrets.ENV_FILE_DEV_CONTENT }}" > client/src/environments/environment.development.ts
- name: Install dependencies
run: |
cd client
npm install --force
- name: Run frontend tests
run: |
cd client
npm run test -- --watch=false --no-progress --browsers=ChromeHeadless
test-backend:
if: contains(github.event.head_commit.message, '[run-all]')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Run backend tests
run: |
chmod +x ./mvnw
./mvnw test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment