Test CI scripts and workflows #105
This file contains hidden or 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: CI (duplicate) | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read # to fetch code | |
| actions: write # to cancel previous workflows | |
| jobs: | |
| lint_and_typecheck: | |
| runs-on: linux-x86-n2-16 | |
| container: | |
| image: "us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build:latest" # ratchet:ubuntu:20.04 | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Install dependencies for setting up Python | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| run: | | |
| apt update && apt install libssl-dev libsqlite3-dev git -y | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: python -m pip install pre-commit | |
| # - name: Add to PATH | |
| # run: export PATH=$PATH:/__w/_tool/Python/3.11.10/x64/bin | |
| # - name: Set python3 alias | |
| # run: echo "alias python3=/__w/_tool/Python/3.11.10/x64/bin/python3" >> ~/.bashrc | |
| # Halt for testing | |
| - name: Wait For Connection | |
| uses: google-ml-infra/actions/ci_connection@main | |
| - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml', 'setup.py') }} | |
| - run: pre-commit run --show-diff-on-failure --color=always --all-files |