|
| 1 | +name: Build and Test |
| 2 | + |
| 3 | +on: push |
| 4 | + |
| 5 | +concurrency: |
| 6 | + group: "${{ github.ref }}" |
| 7 | + cancel-in-progress: true |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + timeout-minutes: 60 |
| 13 | + env: |
| 14 | + GIT_STRATEGY: clone |
| 15 | + steps: |
| 16 | + - name: Set up QEMU |
| 17 | + uses: docker/setup-qemu-action@v3 |
| 18 | + - name: Set up Docker Buildx |
| 19 | + uses: docker/setup-buildx-action@v3 |
| 20 | + - name: Checkout repo |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 20 |
| 24 | + lfs: true |
| 25 | + - name: Build |
| 26 | + uses: docker/build-push-action@v6 |
| 27 | + id: build |
| 28 | + with: |
| 29 | + file: dockerfiles/Dockerfile |
| 30 | + tags: image:latest |
| 31 | + outputs: type=docker,dest=${{ runner.temp }}/template.tar |
| 32 | + - name: Upload |
| 33 | + uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: image |
| 36 | + path: ${{ runner.temp }}/template.tar |
| 37 | + test-cli-template: |
| 38 | + runs-on: ubuntu-latest |
| 39 | + needs: build |
| 40 | + steps: |
| 41 | + - name: Download |
| 42 | + uses: actions/download-artifact@v4 |
| 43 | + with: |
| 44 | + name: image |
| 45 | + path: ${{ runner.temp }} |
| 46 | + - name: Test |
| 47 | + run: | |
| 48 | + docker run -u `id -u`:`id -g` -w /src_cli image pixi run ruff check |
| 49 | + docker run -u `id -u`:`id -g` -w /src_cli image pixi run ruff format --check |
| 50 | + docker run -u `id -u`:`id -g` -w /src_cli image pixi run mypy . |
| 51 | + docker run -u `id -u`:`id -g` -w /src_cli image pixi run pytest . |
| 52 | + test-library-template: |
| 53 | + runs-on: ubuntu-latest |
| 54 | + needs: build |
| 55 | + steps: |
| 56 | + - name: Download |
| 57 | + uses: actions/download-artifact@v4 |
| 58 | + with: |
| 59 | + name: image |
| 60 | + path: ${{ runner.temp }} |
| 61 | + - name: Test |
| 62 | + run: | |
| 63 | + docker run -u `id -u`:`id -g` -w /src_library image pixi run ruff check |
| 64 | + docker run -u `id -u`:`id -g` -w /src_library image pixi run ruff format --check |
| 65 | + docker run -u `id -u`:`id -g` -w /src_library image pixi run mypy . |
| 66 | + docker run -u `id -u`:`id -g` -w /src_library image pixi run pytest . |
| 67 | + test-ndip-tool-template: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + needs: build |
| 70 | + steps: |
| 71 | + - name: Download |
| 72 | + uses: actions/download-artifact@v4 |
| 73 | + with: |
| 74 | + name: image |
| 75 | + path: ${{ runner.temp }} |
| 76 | + - name: Test |
| 77 | + run: | |
| 78 | + docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run ruff check |
| 79 | + docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run ruff format --check |
| 80 | + docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run mypy . |
| 81 | + docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run pytest . |
| 82 | + test-nova-application-template: |
| 83 | + runs-on: ubuntu-latest |
| 84 | + needs: build |
| 85 | + steps: |
| 86 | + - name: Download |
| 87 | + uses: actions/download-artifact@v4 |
| 88 | + with: |
| 89 | + name: image |
| 90 | + path: ${{ runner.temp }} |
| 91 | + - name: Test |
| 92 | + run: | |
| 93 | + docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run ruff check |
| 94 | + docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run ruff format --check |
| 95 | + docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run mypy . |
| 96 | + docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run pytest . |
| 97 | + test-tutorial-template: |
| 98 | + runs-on: ubuntu-latest |
| 99 | + needs: build |
| 100 | + steps: |
| 101 | + - name: Download |
| 102 | + uses: actions/download-artifact@v4 |
| 103 | + with: |
| 104 | + name: image |
| 105 | + path: ${{ runner.temp }} |
| 106 | + - name: Test |
| 107 | + run: | |
| 108 | + docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run ruff check |
| 109 | + docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run ruff format --check |
| 110 | + docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run mypy . |
| 111 | + docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run pytest . |
0 commit comments