Skip to content

Commit 1cdd82c

Browse files
Cv2-5632 migrate check ci (#99)
migrate check ci ---------
1 parent 7764ce0 commit 1cdd82c

8 files changed

+89
-49
lines changed

.github/workflows/ci-test.yaml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build and Run Check Tests
2+
3+
on:
4+
schedule:
5+
- cron: '0 4 * * *' #Runs daily at 4 AM UTC
6+
push:
7+
branches:
8+
- master
9+
- develop
10+
11+
pull_request:
12+
branches:
13+
- develop
14+
15+
permissions:
16+
id-token: write
17+
contents: read
18+
19+
jobs:
20+
check-script:
21+
runs-on:
22+
labels: check
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Configure AWS Credentials
27+
uses: aws-actions/configure-aws-credentials@v4
28+
with:
29+
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
30+
aws-region: eu-west-1
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Before script
39+
env:
40+
GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
41+
GITHUB_JOB_NAME: ${{ github.job }}
42+
run: |
43+
sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
44+
git submodule update --init --recursive
45+
sed -i '/git submodule/d' bin/first-build.sh
46+
sed -i 's/--abort-on-container-exit/-d/' bin/first-build.sh
47+
TAB=$'\t'
48+
export FALLBACK_BRANCH=$([ "$GITHUB_BRANCH" == "master" ] && echo "main" && echo "master" || echo "develop")
49+
git submodule foreach 'bash -c "git checkout master ; git checkout develop ; git checkout $FALLBACK_BRANCH ; git checkout $GITHUB_BRANCH ; exit 0"'
50+
git submodule foreach git rev-parse --abbrev-ref HEAD
51+
52+
- name: Run Script
53+
env:
54+
GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
55+
GITHUB_JOB_NAME: ${{ github.job }}
56+
run: |
57+
./bin/first-build.sh
58+
until curl --silent -I -f --fail http://localhost:3333 ; do printf .; sleep 1; done
59+
sleep 240
60+
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3200)!= "200" )); then exit 1; fi;
61+
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3100)!= "200" )); then exit 1; fi;
62+
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ping)!= "200" )); then exit 1; fi;
63+
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3333)!= "200" )); then exit 1; fi;
64+
if (( $(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000)!= "200" )); then exit 1; fi;
65+
docker ps --format '{{.Image}}' | sort >> docker_up_output.txt
66+
diff <(grep -v 'moby/buildkit:buildx-stable-1' docker_up_output.txt) test/image_names.txt
67+
68+
- name: Cleanup Docker Resources
69+
if: always()
70+
run: |
71+
echo "Running post-job cleanup..."
72+
docker stop $(docker ps -q) || true
73+
docker rm $(docker ps -aq) || true
74+
docker rmi $(docker images -q) || true
75+
docker volume rm $(docker volume ls -q) || true

.travis.yml

-32
This file was deleted.

bin/first-build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ replace_secret 'check-api' 'config/config.yml' 'google_client_id'
1818
replace_secret 'check-api' 'config/config.yml' 'google_client_secret'
1919

2020
# Build & Run
21-
docker-compose build
22-
docker-compose up --abort-on-container-exit
21+
docker compose build
22+
docker compose up --abort-on-container-exit

bin/localtunnel.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ RETVAL=0
44

55
localtunnel_on() {
66
configurator/do.sh deploy localtunnel
7-
docker-compose exec api touch tmp/restart.txt
8-
docker-compose exec pender touch tmp/restart.txt
9-
docker-compose exec web cp config.js build/web/js
7+
docker compose exec api touch tmp/restart.txt
8+
docker compose exec pender touch tmp/restart.txt
9+
docker compose exec web cp config.js build/web/js
1010
lt --port 3000 --subdomain check-api &
1111
lt --port 3333 --subdomain check-web &
1212
lt --port 3200 --subdomain pender &
@@ -15,9 +15,9 @@ localtunnel_on() {
1515
localtunnel_off() {
1616
pkill -f subdomain
1717
configurator/do.sh deploy local
18-
docker-compose exec api touch tmp/restart.txt
19-
docker-compose exec pender touch tmp/restart.txt
20-
docker-compose exec web cp config.js build/web/js
18+
docker compose exec api touch tmp/restart.txt
19+
docker compose exec pender touch tmp/restart.txt
20+
docker compose exec web cp config.js build/web/js
2121
}
2222

2323
case "$1" in

bin/update-l10n.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ cd check-web && git checkout develop && git pull && cd - && \
55
# cd check-search && git checkout develop && git pull && cd - && \
66

77
echo 'Updating Check API translations...' && \
8-
(docker-compose exec api /tx push) && \
9-
(docker-compose exec api /tx pull) && \
8+
(docker compose exec api /tx push) && \
9+
(docker compose exec api /tx pull) && \
1010
# FIXME: Configure check-tiplines resource pulling
1111
# (docker-compose exec api bundle exec rake transifex:download_tipline) && \
1212

1313
echo 'Updating Check Web translations...' && \
14-
(docker-compose exec web npm run transifex:merge-source) && \
15-
(docker-compose exec web /tx push) && \
16-
(docker-compose exec web /tx pull) && \
17-
(docker-compose exec web npm run transifex:merge-translated) && \
14+
(docker compose exec web npm run transifex:merge-source) && \
15+
(docker compose exec web /tx push) && \
16+
(docker compose exec web /tx pull) && \
17+
(docker compose exec web npm run transifex:merge-translated) && \
1818

1919
# echo 'Updating Check Mark translations...' && \
2020
# (docker-compose exec mark npm run transifex:upload) && \

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "2.1"
21
volumes:
32
elasticsearch:
43
postgres:

docker-test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "2.1"
21
networks:
32
default:
43
name: dev

docker-upgradedb.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "2.1"
21
volumes:
32
postgres:
43
postgres11:

0 commit comments

Comments
 (0)