This is an automated email from the ASF dual-hosted git repository. machristie pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit 29309c0c3cbd2d2261fa45c30e04b27b839f0a3b Author: Marcus Christie <[email protected]> AuthorDate: Tue Jan 10 15:21:20 2023 -0500 Build JS code once and then reuse for each Python version --- .github/workflows/build-and-test.yaml | 49 +++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 45dc7a70..986ec0a0 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -1,18 +1,45 @@ name: Build and Test on: [push] jobs: + build-js: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Use Node.js as specified in .nvmrc + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + - name: Run ESLint on JavaScript code + run: | + ./lint_js.sh + - name: Build JavaScript code + run: | + ./build_js.sh + - name: Run JavaScript unit tests + run: | + ./test_js.sh + - uses: actions/upload-artifact@v3 + with: + name: built-javascript + path: | + django_airavata/apps/api/static/django_airavata_api/dist + django_airavata/static/common/dist + django_airavata/apps/admin/static/django_airavata_admin/dist + django_airavata/apps/groups/static/django_airavata_groups/dist + django_airavata/apps/auth/static/django_airavata_auth/dist + django_airavata/apps/workspace/static/django_airavata_workspace/dist + django_airavata/apps/workspace/static/django_airavata_workspace/wc + django_airavata/apps/dataparsers/static/django_airavata_dataparsers/dist + build: # ubuntu-22 doesn't support Python 3.6 runs-on: ubuntu-20.04 + needs: build-js strategy: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 - - name: Use latest LTS Node.js - uses: actions/setup-node@v3 - with: - node-version: 'lts/*' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -29,17 +56,11 @@ jobs: - name: Run flake8 run: | flake8 . - - name: Run ESLint on JavaScript code - run: | - ./lint_js.sh - - name: Build JavaScript code - run: | - ./build_js.sh - - name: Run JavaScript unit tests - run: | - ./test_js.sh - # Need to build the frontend client before running some of the Django tests + # Need the built frontend client code before running some of the Django tests # that use the Django test Client + - uses: actions/download-artifact@v3 + with: + name: built-javascript - name: Run Django unit tests run: | ./runtests.py
