Trying to compile a python script using Github actions

Viewed 82

I have the following script in github actions:

    jobs:
    build:
      runs-on: [ self-hosted ]
      container:
        image: artifactory_url/path/python:3.7.9
      steps:
        - name: checkout
          uses: actions/checkout@v2
        - name: Build Compiled files
          run: |
            mkdir downloads
            cd downloads
            pwd
            python3 -m py_compile ../Library/abc.py 
            ls
            COPY ../qwe.txt qwe.txt

I am facing two problems here:

  • The compile command doesn't show an abc.pyc file in the downloads directory when the ls command is run.

  • The copy command returns an error : /__w/_temp/0cbb9fcc-2932-4339-909e-242f77d6f3b1.sh: 7: /__w/_temp/0cbb9fcc-2932-4339-909e-242f77d6f3b1.sh: COPY: not found with error code 127 (which I believe is the file not found error).

But the qwe.txt file is just a file sitting in the repo in which the downloads folder has been created.

The repo directory looks like this:

Library
downloads
qwe.txt

Output:

  mkdir downloads
  cd downloads
  
  python3 -m py_compile ../Library/abc.py 
  pwd
  ls
  COPY ../qwe.txt qwe.txt
  shell: sh -e {0}

/__w/repo_name/repo_name/downloads
/__w/_temp/0cbb9fcc-2932-4339-909e-242f77d6f3b1.sh: 7: /__w/_temp/0cbb9fcc-2932-4339-909e-242f77d6f3b1.sh: COPY: not found
Error: Process completed with exit code 127.

What am I doing wrong?

0 Answers
Related