Update actions and dev dependencies #266
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
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Build | |
on: [push, pull_request] | |
jobs: | |
# https://github.com/pre-commit/action | |
pre-commit: | |
name: Lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- uses: pre-commit/action@v3.0.1 | |
test: | |
name: Test | |
strategy: | |
# Keep running so we can see if other tests pass | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.8' | |
- '3.12' | |
env: | |
PACKER_VERSION: 1.6.1 | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: dev-requirements.txt | |
- name: Cache packer | |
id: cachepacker | |
uses: actions/cache@v4 | |
with: | |
path: ~/bin | |
key: ${{ runner.os }}-packer-${{ env.PACKER_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -mpip install -r dev-requirements.txt | |
- name: Install repo2shellscript | |
run: python -mpip install . | |
- name: Install https://github.com/jupyterhub/repo2docker/pull/1371 | |
run: | | |
python -mpip install git+https://github.com/manics/repo2docker@tarfile-not-recursive | |
- name: Download packer | |
if: steps.cachepacker.outputs.cache-hit != 'true' | |
run: | | |
mkdir ~/bin | |
cd ~/bin | |
wget -q https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip | |
unzip packer_${PACKER_VERSION}_linux_amd64.zip && rm packer_${PACKER_VERSION}_linux_amd64.zip | |
- name: Run pytest | |
run: pytest -v tests | |
- name: Run repo2shellscript scripts | |
run: | | |
export "PATH=$HOME/bin:$PATH" | |
./run-docker-test.sh |