Skip to content

Continuous Integration #13780

Continuous Integration

Continuous Integration #13780

name: Continuous Integration
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
types: [checks_requested]
workflow_run:
workflows: ["Package"]
branches: [main]
types:
- completed
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/setup-go@v3
with:
go-version: "^1.20"
- name: Build server
working-directory: ./server
run: |
make test
make build-alpine
- name: Build client
run: |
yarn install
CI=false yarn build
- name: Lint code
run: yarn lint --max-warnings 0
- name: Test with coverage
run: yarn test --coverage --watchAll=false --passWithNoTests
package:
needs: test
uses: inovex/scrumlr.io/.github/workflows/package.yml@main
deploy_to_dev_cluster:
needs: package
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' || github.ref_name == 'main'}}
uses: inovex/scrumlr.io/.github/workflows/deploy_to_dev_cluster.yml@main
secrets: inherit
with:
frontend_image_tag: ${{ needs.package.outputs.frontend-image-tag }}
server_image_tag: ${{ needs.package.outputs.server-image-tag }}
deployment_health_check:
needs: deploy_to_dev_cluster
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' || github.ref_name == 'main'}}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: reachability check
uses: ./.github/actions/deployment_health_check
postman_tests:
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' }}
needs: deployment_health_check
uses: ./.github/workflows/postman_tests.yml
with:
base_url: https://${{ github.event.pull_request.number }}.development.scrumlr.fra.ics.inovex.io
octomind_end_to_end_test:
name: Octomind End to End Test
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' }}
needs: deployment_health_check
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: reachability check
uses: ./.github/actions/deployment_health_check
- name: run tests
uses: OctoMind-dev/automagically-action-execute@v2
with:
url: https://${{ github.event.pull_request.number }}.development.scrumlr.fra.ics.inovex.io
token: ${{ secrets.AUTOMAGICALLY_TOKEN }}
testTargetId: ${{ secrets.AUTOMAGICALLY_TEST_TARGET_ID }}
cypress_end_to_end_test:
name: Cypress End to End Test
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' }}
needs: deployment_health_check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start server
run: docker-compose --profile build up -d
working-directory: server
- name: Setup client and run tests
uses: cypress-io/github-action@v6
with:
browser: chrome
start: |
yarn install
yarn run start
working-directory: ./
wait-on: 'http://localhost:3000'