Skip to content

🚧 Update wworking directory in gh workflow #13

🚧 Update wworking directory in gh workflow

🚧 Update wworking directory in gh workflow #13

name: Build image and run pytest
on:
push:
branches:
- test/self-hosted-runner
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Docker image
run: |
docker build -t claasp-lib ./docker/Dockerfile
working-directory: /home/sage/tii-claasp # Specify the path to your app's directory.
- name: Run Tests in Docker
run: |
docker run claasp-lib sh -c make remote-pytest
working-directory: /home/sage/tii-claasp # Specify the path to your app's directory.
# jobs:
# build-and-run-pytest:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# persist-credentials: false
# fetch-depth: 0
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Cache Docker layers
# uses: actions/cache@v3
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-
# - name: Build
# uses: docker/build-push-action@v5
# id: built-image
# with:
# context: .
# file: ./docker/Dockerfile
# push: false
# load: true
# tags: claasp-lib
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
# - name: Run pytests
# run: docker run --rm -v $PWD:/home/sage/tii-claasp claasp-lib make remote-pytest
# run: docker run --rm -v $PWD:/home/sage/tii-claasp claasp-lib:claasp-lib make remote-pytest
# - name: Move cache
# if: ${{ always() }}
# run: |
# rm -rf /tmp/.buildx-cache
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache