fixed mismatchig typescript version issue #1519
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: Testing | |
on: [ push, pull_request ] | |
env: | |
EMG_CONFIG: ${{ github.workspace }}/client-repo/ci/config.yaml | |
API_URL: http://localhost:9000/metagenomics/api/v1/ | |
SEARCH_URL: https://www.ebi.ac.uk/ebisearch/ws/rest/metagenomics_ | |
DEPLOYMENT_SUBFOLDER: /metagenomics | |
BASE_URL: http://localhost:9000/metagenomics/ | |
INTERPRO_URL: http://www.ebi.ac.uk/interpro/ | |
SEQUENCE_SEARCH_URL: https://wwwdev.ebi.ac.uk/metagenomics/sequence-search/search/phmmer | |
ENA_URL: https://www.ebi.ac.uk/ena/browser/view/ | |
CYPRESS_WEBIN_USERNAME: Webin-000 | |
CYPRESS_WEBIN_PASSWORD: secret | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
mongo: | |
image: mongo:4.0.6 | |
ports: | |
- 27017:27017 | |
options: --health-cmd="mongo" --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: client-repo | |
- name: ๐ - Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: ๐ง๐ฌ - Install EMG API | |
run: | | |
pip install --user --upgrade pip setuptools | |
python -V | |
pip -V | |
pip install "git+https://github.com/EBI-metagenomics/emgapi@develop#egg=emgcli" | |
ls -l | |
- name: Set up db files for API | |
working-directory: client-repo | |
run: | | |
sed -i s#{GITHUB_WORKSPACE}#$GITHUB_WORKSPACE#g ci/config.yaml | |
cat ci/config.yaml | |
- name: ๐ช - Setting up Fixtures | |
working-directory: client-repo | |
run: | | |
wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.6.1.deb | |
sudo apt install ./mongodb-database-tools-ubuntu2204-x86_64-100.6.1.deb | |
mongorestore --gzip --archive < ci/testdbs/emg-testdb.mongoarchive | |
emgcli migrate | |
mv ci/emg_api_datafiles/results $GITHUB_WORKSPACE/results | |
- name: โ๏ธ - Settings | |
working-directory: client-repo | |
env: # Or as an environment variable | |
MAPS_KEY: ${{ secrets.GOOGLE_MAPS_DEV_KEY }} | |
run: | | |
echo "{\"googleMapsKey\": \"$MAPS_KEY\", \"api\": \"$API_URL\"}" > "$(pwd)/config.private.json" | |
- uses: actions/checkout@v4 | |
name: ๐ฌ - Checkout EMG API | |
with: | |
repository: 'EBI-Metagenomics/emgapi' | |
ref: 'develop' | |
path: emgapi | |
- name: ๐ฌ - Start EMG API | |
run: | | |
export PYTHONPATH="$PYTHONPATH:${{ github.workspace }}/emgapi/tests/" | |
echo $PYTHONPATH | |
emgcli collectstatic --noinput | |
emgcli check --deploy | |
cd emgapi | |
export GUNICORN_CMD_ARGS="--bind 127.0.0.1:8000 --workers=1 --daemon -p emg.pid --error-logfile error.log --access-logfile access.log" | |
emgdeploy emgcli.wsgi:application | |
ps aux | grep emgdeploy | |
cd .. | |
echo "\ngunicorn v1/" | |
curl --silent http://localhost:8000/v1/ | |
- name: ๐ - Setup NginX | |
working-directory: client-repo | |
run: | | |
sudo chmod 777 /var/log/nginx/* | |
sudo chmod 777 /var/run/* | |
sudo chmod 777 /var/run | |
sed -i s#{GITHUB_WORKSPACE}#$GITHUB_WORKSPACE#g ci/nginx.conf | |
nginx -c "$(pwd)/ci/nginx.conf" | |
- name: ๐ - Set up JS Node 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
cache-dependency-path: client-repo/package-lock.json | |
# TODO: โ ๏ธ the json generated is not understood by codecov | |
# TODO: fix 404s for nested URLs โ nginx config problem? | |
- name: ๐ง - Install | |
working-directory: client-repo | |
run: | | |
npm ci | |
npm run build | |
npm run coverage:instrument | |
cp -r dist metagenomics | |
mv metagenomics /usr/share/nginx/html/metagenomics | |
cp -r coverage/instrumented/* /usr/share/nginx/html/metagenomics/ | |
ls /usr/share/nginx/html/metagenomics | |
echo "=== web index ===" | |
curl --silent http://localhost:9000/metagenomics/ | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
- name: ๐งน - ESlint | |
working-directory: client-repo | |
run: | | |
npm run eslint | |
- name: ๐งช - Testing | |
uses: cypress-io/github-action@v6 | |
with: | |
working-directory: client-repo | |
browser: chrome | |
- name: ๐ - Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: ${{ github.workspace }}/client-repo/coverage/ | |
# TODO: enable sentry when https://github.com/getsentry/action-release/issues/83 is resolved | |
# - name: Sentry Release | |
# uses: getsentry/[email protected] | |
# working-directory: 'client-repo' | |
# env: | |
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
# SENTRY_LOG_LEVEL: 'info' | |
# with: | |
# environment: dev | |
# sourcemaps: './dist/js' | |
# version: ${{ github.sha }} | |
- name: ๐ธ - Failed tests snapshots | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: tests-snapshots | |
path: /home/runner/work/ebi-metagenomics-client/ebi-metagenomics-client/client-repo/cypress/screenshots/ # - name: ๐ - Coverage | |
- name: ๐ - Error log | |
if: failure() | |
run: | | |
echo "NGINX error log" | |
cat /var/log/nginx/error.log | |
echo "NGINX access log" | |
cat /var/log/nginx/access.log | |
- name: ๐ฎ - Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
continue-on-error: true | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' | |
env: | |
SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" | |
SLACK_USERNAME: 'Github Actions API' | |
SLACK_ICON_EMOJI: ':octocat:' | |
SLACK_TITLE: 'webkit results in GitHub Actions' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_CHANNEL: '#metagenomics-notify' | |
MSG_MINIMAL: Actions URL |