Hi,
I am trying to run python in gitea actions.
- uses: https://github.com/actions/setup-python@v4
with:
python-version: '3.9'
But I get this error message:
Version 3.9 was not found in the local cache
I am running act on an arm64 machine with oracle linux.
1 Like
Hey, have you fixed this? I get the same exact error.
jobs:
run_linters:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: https://github.com/actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
Install Python1s
1 ::group::Installed versions
2 Version 3.12.0-alpha.7 was not found in the local cache
3 ::error::The version '3.12.0-alpha.7' with architecture 'x64' was not found for this operating system.%0AThe list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
I ended up building my own image and just run whatever I needed in there. It has python, nodejs, npm and docker installed. Most of the docker related actions will work using my image, buddyspencer/ubuntu-node.
Thanks for your anwser, could you send a link to your Git repository with the node? Also how does your workflow look like?
here.
At least for my use case, the workflow looks like this:
name: docker
on:
push:
branches:
- 'main'
jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: https://github.com/docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PWD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v2
- name: Build image and push to Docker Hub
run: |
pip3 install requests jinja2
OS=linux python3 main.py
. build.env
docker buildx build --push -q --platform linux/amd64,linux/arm64 -t buddyspencer/purpur:${PURPURVERSION} -t buddyspencer/purpur:latest .
volumes:
- /var/run/docker.sock:/var/run/docker.sock
But what you could try is to run your linter in a docker container:
name: container
on: push
jobs:
node-docker:
runs-on: ubuntu-latest
container:
image: node:14.15.0-alpine3.12
steps:
- name: Log the node version
run: |
node -v
cat /etc/os-release
1 Like