Skip to content

Commit

Permalink
Tweak container loading
Browse files Browse the repository at this point in the history
  • Loading branch information
rjfarmer committed Jan 20, 2024
1 parent a3d44ff commit 1d268a4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,29 @@ jobs:
- name: Creates new container
if: steps.container-cache.outputs.cache-hit != 'true'
run: |
docker run --name the_container --interactive -v /:/host -v $(pwd):/gfort2py ${DOCKER_CONTAINER} /bin/bash -c "
docker run --name ${{ matrix.BUILD_PROP[0] }} --interactive -v /:/host -v $(pwd):/gfort2py ${DOCKER_CONTAINER} /bin/bash -c "
apt-get update &&
apt-get install -y cmake git python3 python-is-python3 python3-dev python3-venv python3-pip python3-numpy automake libc6-dev linux-libc-dev gcc gfortran &&
git config --global --add safe.directory /gfort2py &&
python -m pip install build wheel pytest cpyparsing platformdirs
"
docker commit the_container the_container
docker save -o "~/docker_${TOOLCHAIN_NAME}.tar" the_container
docker commit ${{ matrix.BUILD_PROP[0] }} ${{ matrix.BUILD_PROP[0] }}
mkdir -p "~/docker_${TOOLCHAIN_NAME}"
docker save -o "~/docker_${TOOLCHAIN_NAME}/the_container.tar" ${{ matrix.BUILD_PROP[0] }}
- name: Load container from cache
if: steps.container-cache.outputs.cache-hit == 'true'
run: docker load -i "~/docker_${TOOLCHAIN_NAME}.tar"
run: docker load -i "~/docker_${TOOLCHAIN_NAME}/the_container.tar"

- name: Build
run: |
docker run --rm -e "TERM=xterm-256color" -v $(pwd):/gfort2py -v /:/host the_container \
docker run --rm -e "TERM=xterm-256color" -v $(pwd):/gfort2py -v /:/host ${{ matrix.BUILD_PROP[0] }}\
/bin/script -e -q -c "/bin/bash --noprofile --norc -eo pipefail -c '
cd /gfort2py && python -m build && python -m pip install dist/gfort2py*.whl
'"
- name: Run Tests
run: |
docker run --rm -e "TERM=xterm-256color" -v $(pwd):/gfort2py -v /:/host the_container \
docker run --rm -e "TERM=xterm-256color" -v $(pwd):/gfort2py -v /:/host ${{ matrix.BUILD_PROP[0] }} \
/bin/script -e -q -c "/bin/bash --noprofile --norc -eo pipefail -c '
export FC=/usr/bin/gfortran
cd /gfort2py && python -m pytest -v
Expand Down

0 comments on commit 1d268a4

Please sign in to comment.