Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CV2-4794-remove travis.yml for CI #1961

Merged
merged 105 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
3092aa7
remove travis.yml
Jul 18, 2024
290f443
add slack notification
Jul 18, 2024
5064ad1
add slack notification
Jul 18, 2024
9faebc6
remove notification
Jul 18, 2024
8d1b2a1
set workflow to run on push to develop branch
Jul 19, 2024
6592dd4
modify after test to fix codeclimate
Jul 19, 2024
e511cdf
modify after test to fix codeclimate
Jul 19, 2024
41c3d9b
modify after test to fix codeclimate
Jul 19, 2024
fbe4153
modify after test to fix codeclimate
Jul 19, 2024
bf3f646
remove coverage job
Jul 19, 2024
db3ce67
remove coverage job
Jul 19, 2024
493a247
fix yaml
Jul 19, 2024
9385e1b
fix yaml
Jul 19, 2024
44dc971
remove last step
Jul 19, 2024
c2135ef
fix conflict
Jul 19, 2024
74929d0
add codeclimate
Jul 19, 2024
b4350ca
remove location
Jul 19, 2024
f160bd8
modify codeclimate coverage
Jul 19, 2024
15be102
fix yml lint
Jul 19, 2024
a3ba18f
remove gem installer step
Jul 19, 2024
78066d5
remove gem installer step
Jul 19, 2024
0129326
remove gem installer step
Jul 19, 2024
0766c8d
remove gem installer step
Jul 19, 2024
d771745
remove gem installer step
Jul 19, 2024
8099bf4
fix tests-coverage
Jul 20, 2024
b37f78b
add job name
Jul 20, 2024
245b7cc
add job name
Jul 20, 2024
490ffd6
add job name
Jul 20, 2024
ed34256
change path
Jul 20, 2024
b8db1c8
change path
Jul 20, 2024
a4c22c5
change path
Jul 20, 2024
8ada0b8
change path
Jul 20, 2024
74540e2
change path
Jul 20, 2024
d0c2810
change path
Jul 20, 2024
56c2cdf
change path
Jul 20, 2024
e51bcfd
change path
Jul 20, 2024
a3012b0
change path
Jul 20, 2024
f0f702b
change path
Jul 20, 2024
27f8971
change path
Jul 20, 2024
8cbe010
change path
Jul 20, 2024
71d7377
change path
Jul 20, 2024
0a98928
change path
Jul 20, 2024
7644ab7
change path
Jul 20, 2024
ab61229
change path
Jul 20, 2024
f33bc36
rewrite coverage
Jul 20, 2024
ad0d29c
rewrite coverage
Jul 20, 2024
479d4a3
rewrite coverage
Jul 20, 2024
31ad3a0
rewrite coverage
Jul 20, 2024
5cb4586
rewrite coverage
Jul 20, 2024
0967fde
rewrite coverage
Jul 20, 2024
d7a6d36
rewrite coverage
Jul 20, 2024
62893bb
rewrite coverage
Jul 20, 2024
263e079
rewrite coverage
Jul 20, 2024
103c502
rewrite coverage
Jul 20, 2024
35968c2
rewrite coverage
Jul 20, 2024
d058dcc
rewrite coverage
Jul 20, 2024
b0ed08a
rewrite coverage
Jul 20, 2024
33f0eaf
rewrite coverage
Jul 20, 2024
fcbfadb
rewrite coverage
Jul 20, 2024
55b07d7
rewrite coverage
Jul 20, 2024
2b1dd36
rewrite coverage
Jul 21, 2024
a620c9e
rewrite coverage
Jul 21, 2024
377cd66
rewrite coverage
Jul 21, 2024
4f346b9
rewrite coverage
Jul 21, 2024
b1d5839
rewrite coverage
Jul 21, 2024
b9a4c1d
rewrite coverage
Jul 21, 2024
d51dd25
rewrite coverage
Jul 21, 2024
f3266b3
rewrite coverage
Jul 21, 2024
ffe0a39
rewrite coverage
Jul 21, 2024
79e396d
rewrite coverage
Jul 21, 2024
ac79339
rewrite coverage
Jul 21, 2024
d13b838
rewrite coverage
Jul 21, 2024
89ef769
rewrite coverage
Jul 21, 2024
50295e1
rewrite coverage
Jul 21, 2024
a75f4ab
rewrite coverage
Jul 21, 2024
2054c7a
rewrite coverage
Jul 21, 2024
80c4d2d
rewrite coverage
Jul 21, 2024
a6ff075
rewrite coverage
Jul 21, 2024
b68a10b
rewrite coverage
Jul 21, 2024
8ca2943
rewrite coverage
Jul 21, 2024
71caeb7
rewrite coverage
Jul 21, 2024
e44d93b
rewrite coverage
Jul 21, 2024
b9bc590
rewrite coverage
Jul 21, 2024
c6b70f5
rewrite coverage
Jul 21, 2024
969ca43
rewrite coverage
Jul 21, 2024
f4dad78
rewrite coverage
Jul 21, 2024
846b87d
rewrite coverage
Jul 21, 2024
dd4c61d
rewrite coverage
Jul 21, 2024
3c6497c
rewrite coverage
Jul 21, 2024
4292b44
rewrite coverage
Jul 21, 2024
5e5e24b
rewrite coverage
Jul 21, 2024
057ef9f
rewrite coverage
Jul 21, 2024
fdf626c
rewrite coverage
Jul 21, 2024
750489d
rewrite coverage
Jul 21, 2024
0ac1dc2
rewrite coverage
Jul 21, 2024
270929b
rewrite coverage
Jul 21, 2024
38f59c3
rewrite coverage
Jul 21, 2024
480b8be
rewrite coverage
Jul 21, 2024
5fa6837
Update format-coverage.sh
chinelo-obitube Jul 21, 2024
8eba5df
Update sum-upload-coverage.sh
chinelo-obitube Jul 21, 2024
cb7ca00
rewrite coverage
Jul 21, 2024
01a8c63
rewrite coverage
Jul 21, 2024
dc6fd8d
rewrite coverage-tests
Jul 21, 2024
4e2b4d1
rewrite code-climate test scripts
Jul 21, 2024
9af1290
change check-api ci bucket
Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 82 additions & 36 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- master
- develop
pull_request:
branches:
- develop
Expand Down Expand Up @@ -81,25 +82,40 @@ jobs:
chmod +w tmp/parallel_runtime_test.log

- name: Run Functional Tests
id: run-tests
id: functional-tests
env:
TEST_RETRY_COUNT: 3
run: |
docker-compose exec -e TEST_RETRY_COUNT=$TEST_RETRY_COUNT -T -e PATTERN='models mailers integration workers lib contract' api test/run-tests.sh

- name: After functional Tests
id: after-functional-tests
- name: After Functional Test
env:
GIT_SHA: ${{ github.sha }}
GIT_COMMITED_AT: ${{ github.event.head_commit.timestamp }}
run: |
docker-compose exec -T -e GIT_COMMIT_SHA=${{ github.sha }} \
-e GIT_COMMITTED_AT=${{ github.event.head_commit.timestamp }} \
GITHUB_PULL_REQUEST: ${{ github.event_name}}
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TEST_RESULT: ${{ steps.functional-tests.outcome}}
GITHUB_BUILD_NUMBER: ${{ github.run_number }}
GITHUB_COMMIT_SHA: ${{ github.sha }}
GITHUB_JOB_NAME: ${{ github.job }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
AWS_REGION: eu-west-1
run: |
docker-compose exec -T -e GIT_BRANCH=$GIT_BRANCH \
-e GITHUB_PULL_REQUEST=$GITHUB_PULL_REQUEST \
-e GITHUB_TEST_RESULT=$GITHUB_TEST_RESULT \
-e GITHUB_REPO_SLUG=$GITHUB_REPO_SLUG \
-e GITHUB_BUILD_NUMBER=$GITHUB_BUILD_NUMBER \
-e GIT_COMMIT_SHA=$GITHUB_COMMIT_SHA \
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \
-e PATH=$PATH \
-e JOB_NAME=functional-tests \
-e AWS_CONFIG_FILE=/app/credentials \
api test/test-coverage.sh
-e GITHUB_JOB_NAME=$GITHUB_JOB_NAME \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e ROLE_TO_ASSUME=$AWS_ROLE_TO_ASSUME \
-e AWS_REGION=$AWS_REGION \
-e AWS_CONFIG_FILE=/app/credentials api test/test-coverage.sh


unit-tests:
Expand Down Expand Up @@ -169,25 +185,40 @@ jobs:
chmod +w tmp/parallel_runtime_test.log

- name: Run Unit Tests
id: run-tests
id: unit-tests
env:
TEST_RETRY_COUNT: 3
run: |
docker-compose exec -e TEST_RETRY_COUNT=$TEST_RETRY_COUNT -T -e PATTERN='controllers contract' api test/run-tests.sh

- name: After unit Tests
id: unit-tests
- name: After Unit Test
env:
GIT_SHA: ${{ github.sha }}
GIT_COMMITED_AT: ${{ github.event.head_commit.timestamp }}
run: |
docker-compose exec -T -e GIT_COMMIT_SHA=${{ github.sha }} \
-e GIT_COMMITTED_AT=${{ github.event.head_commit.timestamp }} \
GITHUB_PULL_REQUEST: ${{ github.event_name}}
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TEST_RESULT: ${{ steps.unit-tests.outcome}}
GITHUB_BUILD_NUMBER: ${{ github.run_number }}
GITHUB_COMMIT_SHA: ${{ github.sha }}
GITHUB_JOB_NAME: ${{ github.job }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
AWS_REGION: eu-west-1
run: |
docker-compose exec -T -e GIT_BRANCH=$GIT_BRANCH \
-e GITHUB_PULL_REQUEST=$GITHUB_PULL_REQUEST \
-e GITHUB_TEST_RESULT=$GITHUB_TEST_RESULT \
-e GITHUB_REPO_SLUG=$GITHUB_REPO_SLUG \
-e GITHUB_BUILD_NUMBER=$GITHUB_BUILD_NUMBER \
-e GIT_COMMIT_SHA=$GITHUB_COMMIT_SHA \
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \
-e PATH=$PATH \
-e JOB_NAME=unit-tests \
-e AWS_CONFIG_FILE=/app/credentials \
api test/test-coverage.sh
-e GITHUB_JOB_NAME=$GITHUB_JOB_NAME \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e ROLE_TO_ASSUME=$AWS_ROLE_TO_ASSUME \
-e AWS_REGION=$AWS_REGION \
-e AWS_CONFIG_FILE=/app/credentials api test/test-coverage.sh


contract-tests:
Expand Down Expand Up @@ -265,17 +296,32 @@ jobs:
TEST_RETRY_COUNT: 3
run: |
docker-compose exec -e TEST_RETRY_COUNT=$TEST_RETRY_COUNT -T -e PATTERN='controllers models mailers integration workers lib' api test/run-tests.sh

- name: After contract Tests
id: after-tests

- name: After coverage Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "After Contract Test"

env:
GIT_SHA: ${{ github.sha }}
GIT_COMMITED_AT: ${{ github.event.head_commit.timestamp }}
run: |
docker-compose exec -T -e GIT_COMMIT_SHA=${{ github.sha }} \
-e GIT_COMMITTED_AT=${{ github.event.head_commit.timestamp }} \
GITHUB_PULL_REQUEST: ${{ github.event_name}}
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TEST_RESULT: ${{ steps.run-tests.outcome}}
GITHUB_BUILD_NUMBER: ${{ github.run_number }}
GITHUB_COMMIT_SHA: ${{ github.sha }}
GITHUB_JOB_NAME: ${{ github.job }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
AWS_REGION: eu-west-1
run: |
docker-compose exec -T -e GIT_BRANCH=$GIT_BRANCH \
-e GITHUB_PULL_REQUEST=$GITHUB_PULL_REQUEST \
-e GITHUB_TEST_RESULT=$GITHUB_TEST_RESULT \
-e GITHUB_REPO_SLUG=$GITHUB_REPO_SLUG \
-e GITHUB_BUILD_NUMBER=$GITHUB_BUILD_NUMBER \
-e GIT_COMMIT_SHA=$GITHUB_COMMIT_SHA \
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \
-e PATH=$PATH \
-e JOB_NAME=contract-tests \
-e AWS_CONFIG_FILE=/app/credentials \
api test/test-coverage.sh
-e GITHUB_JOB_NAME=$GITHUB_JOB_NAME \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e ROLE_TO_ASSUME=$AWS_ROLE_TO_ASSUME \
-e AWS_REGION=$AWS_REGION \
-e AWS_CONFIG_FILE=/app/credentials api test/test-coverage.sh
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions test/format-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

apt-get install -y awscli

if [ "$TRAVIS_PULL_REQUEST" == "false" ]
if [ "$GITHUB_PULL_REQUEST" == "pull_request" ]
then
./test/cc-test-reporter format-coverage -t simplecov --output ../coverage/codeclimate.$TRAVIS_JOB_NAME.json ../coverage/.resultset.json
aws s3 cp ../coverage/codeclimate.$TRAVIS_JOB_NAME.json s3://check-api-travis/codeclimate/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/codeclimate.$TRAVIS_JOB_NAME.json
./test/cc-test-reporter format-coverage -t simplecov --output ../coverage/codeclimate.$GITHUB_JOB_NAME.json ../coverage/.resultset.json
aws s3 cp ../coverage/codeclimate.$GITHUB_JOB_NAME.json s3://check-api-travis/codeclimate/$GITHUB_REPO_SLUG/$GITHUB_BUILD_NUMBER/codeclimate.$GITHUB_JOB_NAME.json
fi

6 changes: 3 additions & 3 deletions test/sum-upload-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ $TRAVIS_TEST_RESULT == 0 ]]
if [[ "$GITHUB_PULL_REQUEST" == "pull_request" ]] && [[ "$GITHUB_TEST_RESULT" == 'success' ]]
then
rm -rf ../coverage/*
aws s3 cp --recursive s3://check-api-travis/codeclimate/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/ ../coverage
aws s3 cp --recursive s3://check-api-travis/codeclimate/$GITHUB_REPO_SLUG/$GITHUB_BUILD_NUMBER/ ../coverage
if [[ $(ls ../coverage/codeclimate.* | wc -l) -eq 3 ]]
then
# Make sure we are not dealing with a file that is still being uploaded
Expand All @@ -15,7 +15,7 @@ then
sleep 5
size=$(du -s ../coverage/ | cut -f1)
done
./cc-test-reporter sum-coverage --output - --parts 3 ../coverage/codeclimate.* | sed 's/\/home\/travis\/build\/meedan\/check-api\///g' > ../coverage/codeclimate.json
./cc-test-reporter sum-coverage --output - --parts 3 ../coverage/codeclimate.* | sed 's/\/home\/runner\/work\/check-api\///g' > ../coverage/codeclimate.json
cat ../coverage/codeclimate.json | ./cc-test-reporter upload-coverage --input -
./cc-test-reporter show-coverage ../coverage/codeclimate.json
fi
Expand Down
Loading