-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.23 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: ci
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '*.md'
permissions:
contents: read
pages: write
id-token: write
env:
RINHA_GATLING_VERSION: 3.10.3
RINHA_DIR: rinha-de-backend-2024-q1
jobs:
publish:
name: publish
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: docker login
run: |
echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: publish api
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/rinha-2024q1-api-nodejs .
docker push ${{ secrets.DOCKER_USERNAME }}/rinha-2024q1-api-nodejs
load-test:
name: load-test
runs-on: ubuntu-latest
needs: publish
steps:
- name: checkout
uses: actions/checkout@v4
- name: java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: running everything
run: docker-compose -f docker-compose-final.yml up --build --force-recreate -d
- name: test
run: |
git clone --depth 1 --single-branch -b main https://github.com/zanfranceschi/rinha-de-backend-2024-q1.git
wget -P $RINHA_DIR https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/$RINHA_GATLING_VERSION/gatling-charts-highcharts-bundle-$RINHA_GATLING_VERSION-bundle.zip
unzip -d $RINHA_DIR $RINHA_DIR/gatling-charts-highcharts-bundle-$RINHA_GATLING_VERSION-bundle.zip
./bin/executar-teste-local
echo GATLING_REPORT=$(ls $RINHA_DIR/load-test/user-files/results | sort | head -n 1) >> $GITHUB_ENV
- name: fix permissions
run: |
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: upload test results
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.RINHA_DIR }}/load-test/user-files/results/${{ env.GATLING_REPORT }}
retention-days: 2
- name: deploy results
id: deployment
uses: actions/deploy-pages@v4