Merge pull request #410 from GateNLP/dev #588
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test image build and run Integration tests | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
branches: | |
- master | |
- dev | |
env: | |
MAIN_IMAGE: teamware-main | |
STATIC_IMAGE: teamware-static | |
DJANGO_DB_NAME: teamware_integration_db | |
DJANGO_SETTINGS_MODULE: teamware.settings.docker-integration | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Buildx cache | |
uses: actions/cache@v3 | |
with: | |
path: buildx-cache | |
key: ${{ runner.os }}-buildx-${{ hashFiles('buildx-cache/**') }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Generate env | |
shell: bash | |
run: | | |
./generate-docker-env.sh | |
# Remove container registry address | |
sed -i 's/ghcr.io\/gatenlp\///g' .env | |
# Display the environment variable file for the logs | |
cat .env | |
- name: Build images | |
run: | | |
BUILDX_ARGS_BACKEND="--cache-from type=local,src=buildx-cache --cache-to type=local,dest=buildx-cache-out,mode=max" | |
export BUILDX_ARGS_BACKEND | |
BUILDX_ARGS_FRONTEND="--cache-from type=local,src=buildx-cache-out" | |
export BUILDX_ARGS_FRONTEND | |
./build-images.sh | |
rm -rf buildx-cache && mv buildx-cache-out buildx-cache | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Run integration tests with cypress | |
uses: cypress-io/github-action@v4 | |
with: | |
start: /bin/bash deploy.sh integration | |
wait-on: 'http://localhost:8076' | |
config: baseUrl=http://localhost:8076 | |
record: false | |
env: | |
CYPRESS_TESTENV: ci | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |