Skip to content

Update GH workflow #284

Update GH workflow

Update GH workflow #284

Workflow file for this run

# 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-24.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.7'
- '3.10'
env:
PACKER_VERSION: 1.6.1
runs-on: ubuntu-24.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
- 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: 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