Skip to content

migrate check ci

migrate check ci #3

Workflow file for this run

name: Build and Run Check Tests
on:
push:
branches:
- master
- develop
- CV2-5632-migrate-check-ci
pull_request:
branches:
- develop
env:
CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}"
jobs:
check-script:
runs-on: ubuntu-latest
steps:
# - name: Set permissions for _work directory
# run: |
# sudo chown -R $USER:$USER $GITHUB_WORKSPACE
# sudo chmod 755 $GITHUB_WORKSPACE
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: eu-west-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Before script
run: |
sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
git submodule update --init --recursive
sed -i '/git submodule/d' bin/first-build.sh
sed -i 's/--abort-on-container-exit/-d/' bin/first-build.sh
TAB=$'\t'
export FALLBACK_BRANCH=$([ "$GITHUB_BRANCH" == "master" ] && echo "main" && echo "master" || echo "develop")
git submodule foreach 'bash -c "git checkout master ; git checkout develop ; git checkout $FALLBACK_BRANCH ; git checkout $TRAVIS_BRANCH ; exit 0"'
git submodule foreach git rev-parse --abbrev-ref HEAD
- name: Run Script
run: |
./bin/first-build.sh
until curl --silent -I -f --fail http://localhost:3333 ; do printf .; sleep 1; done
sleep 240
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3200)!= "200" )); then exit 1; fi; # Pender
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3100)!= "200" )); then exit 1; fi; # Alegre
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ping)!= "200" )); then exit 1; fi; # Presto
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3333)!= "200" )); then exit 1; fi; # Check Web
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000)!= "200" )); then exit 1; fi; # Check API
docker ps --format '{{.Image}}' | sort >> docker_up_output.txt
diff docker_up_output.txt test/image_names.txt