diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index beb00244c..b0ccd293c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,9 +7,24 @@ jobs: mypy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: get date for caching + id: get-week-number + run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT + shell: bash + + - name: cache pip packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }} + - run: python -m pip install tox + - run: python -m tox run -e mypy test: @@ -20,12 +35,30 @@ jobs: name: "Run Tests on ${{ matrix.os }}, py${{ matrix.py }}" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.py }} - - name: install requirements - run: python -m pip install tox + + - name: get date for caching + id: get-week-number + run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT + shell: bash + + - name: cache pip packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }} + + - run: python -m pip install tox + + - name: cache tox virtualenvs + uses: actions/cache@v3 + with: + path: .tox + key: tox-os-${{ runner.os }}-py${{ matrix.py }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }}-hash-${{ hashFiles('tox.ini', 'setup.cfg') }} + - name: test run: python -m tox run -m ci - name: twine-check @@ -35,15 +68,30 @@ jobs: name: "Self-Check" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: get date for caching + id: get-week-number + run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT + shell: bash + + - name: cache pip packages + uses: actions/cache@v3 with: - python-version: '3.11' + path: ~/.cache/pip + key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }} + - name: install from source run: | python -m pip install -U pip setuptools python -m pip install . + - name: run on own workflows via HTTPS schema run: check-jsonschema --schemafile "https://json.schemastore.org/github-workflow" .github/workflows/*.yaml + - name: run on own workflows via vendored schema run: check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yaml diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index 065c8a540..7e64fc5fe 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -10,12 +10,17 @@ jobs: vendor-schemas: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: install tox run: python -m pip install 'tox' + - name: vendor-schemas run: make vendor-schemas + # this action seems to have significant usage, so it should be stable # can always re-implement with `git status --porcelain`, etc. if necessary - name: Create Pull Request diff --git a/tox.ini b/tox.ini index 7573c6839..095255007 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ labels = envlist = cov_clean py{311,310,39,38,37} - py{37,310}-{tomli}{,-format} + py{37,310}-tomli{,-format} py{37,311}-{json5,pyjson5} cov skip_missing_interpreters = true