From 3b3ba0b87ef4b7e8efc7c51be20b67dbf021abbc Mon Sep 17 00:00:00 2001 From: Arona Jones Date: Thu, 28 Jan 2021 02:08:22 +0000 Subject: [PATCH] Different approach to CI dependencies --- .github/workflows/django.yml | 74 ++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 4c035987..d4bb2528 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -8,16 +8,46 @@ on: jobs: dependencies: + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: bahmutov/npm-install@v1 - - run: node node_modules/gulp/bin/gulp build - - name: Cache gulp output - uses: actions/cache@v2 - with: - path: static/ - key: static-${{ hashFiles('package-lock.json') }}-${{ hashFiles('RIGS/static') }} + - uses: actions/checkout@v2 + - uses: bahmutov/npm-install@v1 + - run: node node_modules/gulp/bin/gulp build + - name: Cache gulp output + uses: actions/cache@v2 + with: + path: static/ + key: static-${{ hashFiles('package-lock.json') }}-${{ hashFiles('pipeline/source_assets') }} + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Cache python deps + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }} + - name: Setup Chromedriver + if: \!${{ matrix.parallel }} + run: | + wget https://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip + unzip chromedriver_linux64.zip + export PATH=$PATH:$(pwd) + chmod +x chromedriver + export PATH=$PATH:/usr/lib/chromium-browser/ + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install pycodestyle coverage coveralls django_coverage_plugin + pip install --upgrade --upgrade-strategy eager -r requirements.txt + python manage.py collectstatic --noinput + - name: Basic Checks + run: | + pycodestyle . --exclude=migrations,importer* + python manage.py check + python manage.py makemigrations --check --dry-run test: if: "!contains(github.event.head_commit.message, '[ci skip]')" needs: dependencies @@ -28,34 +58,6 @@ jobs: matrix: test-group: ["RIGS", "versioning", "users", "assets"] steps: - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Cache python deps - uses: actions/cache@v2 - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }} - - name: Setup Chromedriver - if: \!${{ matrix.parallel }} - run: | - wget https://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - export PATH=$PATH:$(pwd) - chmod +x chromedriver - export PATH=$PATH:/usr/lib/chromium-browser/ - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install pycodestyle coverage coveralls django_coverage_plugin - pip install --upgrade --upgrade-strategy eager -r requirements.txt - python manage.py collectstatic --noinput - - name: Basic Checks - run: | - pycodestyle . --exclude=migrations,importer* - python manage.py check - python manage.py makemigrations --check --dry-run - name: Run Tests run: coverage run -p -m pytest --cov=${{ matrix.test-group }} --cov-append -n 8 ${{ matrix.test-group }}/tests/ - uses: actions/upload-artifact@v2