77 name : lint
88 runs-on : ubuntu-latest
99 steps :
10- - uses : actions/checkout@v2
11- - uses : actions/setup-go@v2
10+ - uses : actions/checkout@v3
11+ - uses : actions/setup-go@v3
1212 with :
1313 go-version : " 1.18"
1414 - name : golangci-lint
@@ -19,29 +19,101 @@ jobs:
1919 runs-on : ubuntu-latest
2020 name : tests
2121 env :
22- REVIZOR_URL : ${{ secrets.REVIZOR_URL }}
23- REVIZOR_TOKEN : ${{ secrets.REVIZOR_TOKEN }}
2422 SCALR_TOKEN : ${{ secrets.SCALR_TOKEN }}
2523 UPSTREAM_ID : ${{ github.run_number }}
2624 steps :
27- - uses : actions/checkout@v2
28- - uses : actions/setup-go@v2
25+ - uses : actions/checkout@v3
26+ - uses : actions/setup-go@v3
2927 with :
3028 go-version : " 1.18"
29+ - name : Clone fatmouse repo
30+ uses : actions/checkout@v3
31+ with :
32+ repository : Scalr/fatmouse
33+ path : fatmouse
34+ token : ${{ secrets.GH_PAT }}
3135 - name : Set API_BRANCH
3236 if : ${{ contains(github.event.head_commit.message, '[API_BRANCH]') }}
3337 run : echo "API_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
3438 - name : Set DB_BRANCH
3539 if : ${{ contains(github.event.head_commit.message, '[DB_BRANCH]') }}
3640 run : echo "DB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
41+ - id : auth
42+ uses : google-github-actions/auth@v0
43+ with :
44+ credentials_json : ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
45+ - name : Set up Cloud SDK
46+ uses : google-github-actions/setup-gcloud@v0
47+ - name : Copy secrets
48+ shell : bash
49+ run : |
50+ mkdir ~/.scalr-labs
51+ gsutil cp gs://drone_bucket/prod/private.d/.secrets.yaml fatmouse/tacobell/.secrets.yaml
52+ gsutil cp gs://drone_bucket/prod/private.d/github.json ~/.scalr-labs/github.json
53+ - name : Configure docker
54+ shell : bash
55+ run : gcloud auth configure-docker eu.gcr.io
56+ - name : Pull python builder
57+ shell : bash
58+ run : |
59+ echo "::group::Pull python builder image"
60+ docker pull eu.gcr.io/development-156220/fatmouse/python-builder:master
61+ docker tag eu.gcr.io/development-156220/fatmouse/python-builder:master fatmouse/python-builder:master
62+ echo "::endgroup::"
63+ - name : Get current job log URL
64+ uses : Tiryoh/gha-jobid-action@v0
65+ id : get-job-id
66+ with :
67+ github_token : ${{ secrets.GITHUB_TOKEN }}
68+ job_name : ${{ github.job }}
69+ - name : Generate run tag
70+ shell : bash
71+ run : |
72+ if [ ${{ github.run_attempt }} = 1 ]; then
73+ RERUN_SUFFIX=""
74+ else
75+ RERUN_SUFFIX=$(echo -${{ github.run_attempt }})
76+ fi
77+ echo "RUN_TAG=e2e-${{ github.workflow }}-${{ github.job }}-${{ github.run_number }}${RERUN_SUFFIX}" >> $GITHUB_ENV
3778 - name : Create container
3879 id : create
39- uses : Scalr/gh-action-revizor@master
40- with :
41- command : create
80+ shell : bash
81+ run : |
82+ if [ -z ${{ env.API_BRANCH }} ]; then
83+ FATMOUSE_BRANCH=""
84+ else
85+ FATMOUSE_BRANCH="--fatmouse-branch ${{ env.API_BRANCH }}"
86+ fi
87+
88+ if [ -z ${{ env.DB_BRANCH }} ]; then
89+ SCALR_BRANCH=""
90+ else
91+ SCALR_BRANCH="--scalr-branch ${{ env.DB_BRANCH }}"
92+ fi
93+
94+ if [ "${{ env.API_BRANCH }}" = "staging" ]; then
95+ IMAGE="--scalr-server-image-tag staging"
96+ else
97+ IMAGE=""
98+ fi
99+
100+ docker run --rm \
101+ -e GITHUB_WORKSPACE=true \
102+ -e GITHUB_OUTPUT=/fatmouse/output \
103+ -w /fatmouse \
104+ -v $PWD/fatmouse:/fatmouse \
105+ -v $GITHUB_OUTPUT:/fatmouse/output \
106+ -v ~/.scalr-labs:/etc/scalr-labs \
107+ fatmouse/python-builder:master python -u clickfile.py te up \
108+ ${FATMOUSE_BRANCH} ${SCALR_BRANCH} ${IMAGE} \
109+ --run-url ${{ steps.get-job-id.outputs.html_url }} \
110+ --skip-ui-build \
111+ --cpu=1 \
112+ --ram=2G \
113+ ${{ env.RUN_TAG }}
42114 - name : Run tests
43115 env :
44- SCALR_ADDRESS : https:// ${{ steps.create.outputs.hostname }}
116+ SCALR_ADDRESS : ${{ steps.create.outputs.host }}
45117 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46118 TEST_AWS_ACCESS_KEY : ${{ secrets.TEST_AWS_ACCESS_KEY }}
47119 TEST_AWS_SECRET_KEY : ${{ secrets.TEST_AWS_SECRET_KEY }}
@@ -62,8 +134,13 @@ jobs:
62134 run : goveralls -coverprofile=covprofile -service=github
63135 - name : Delete container
64136 id : delete
65- if : ${{ always() && steps.create.outputs.container_id }}
66- uses : Scalr/gh-action-revizor@master
67- with :
68- command : delete
69- container_id : ${{ steps.create.outputs.container_id }}
137+ if : ${{ always() }}
138+ shell : bash
139+ run : |
140+ docker run --rm \
141+ -w /fatmouse \
142+ -v $PWD/fatmouse:/fatmouse \
143+ -v ~/.scalr-labs:/etc/scalr-labs \
144+ fatmouse/python-builder:master \
145+ python -u clickfile.py te rm \
146+ --no-wait ${{ env.RUN_TAG }}
0 commit comments