diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 14a5ab7be5..b2731b756e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -5,9 +5,16 @@ on: pull_request: release: types: [created] + schedule: + - cron: '0 0 * * *' + +concurrency: + group: build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: - build: - name: Run tests + format: + name: Check the code format runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -31,15 +38,12 @@ jobs: run: | pip install -r requirements.txt --progress-bar off pip install -e "." --progress-bar off - - name: Test with pytest - run: | - pytest --cov=keras_nlp --cov-report xml:coverage.xml - - name: Run integration tests - run: | - python pip_build.py --install && cd integration_tests && pytest . - format: - name: Check the code format + - name: Lint + run: bash shell/lint.sh + build: + name: Run tests runs-on: ubuntu-latest + needs: format steps: - uses: actions/checkout@v2 - name: Set up Python 3.8 @@ -62,5 +66,6 @@ jobs: run: | pip install -r requirements.txt --progress-bar off pip install -e "." --progress-bar off - - name: Lint - run: bash shell/lint.sh + - name: Test with pytest + run: | + pytest --cov=keras_nlp --cov-report xml:coverage.xml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 1c998b0514..0000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Test Nightly - -on: - push: - pull_request: - schedule: - - cron: '0 0 * * *' - -jobs: - build: - name: Run tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v1 - # TODO: we probably want 3.8 here, but are facing an issue with core - # keras. - with: - python-version: 3.9 - - name: Get pip cache dir - id: pip-cache - run: | - python -m pip install --upgrade pip setuptools - echo "::set-output name=dir::$(pip cache dir)" - - name: pip cache - uses: actions/cache@v2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install dependencies - run: | - pip install -r requirements-nightly.txt --progress-bar off - # --no-deps so pip will not try to install tf and tf-text stable - # versions after installing the nightly versions above. - pip install --no-deps -e "." --progress-bar off - - name: Test with pytest - run: | - pytest --cov=keras_nlp --cov-report xml:coverage.xml - - name: Run integration tests - run: | - python pip_build.py --install && cd integration_tests && pytest .