Add GITHUB_WORKSPACE to path to fix test render #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build kicad-render image | |
on: | |
push: | |
paths: | |
- Dockerfile | |
- '*.sh' | |
- .github/workflows/image.yaml | |
jobs: | |
test: | |
name: Test render-pcb.sh | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/linalinn/kicad:nightly | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: simple render | |
run: bash PATH="${GITHUB_WORKSPACE}:$PATH" render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" && test -s "${GITHUB_WORKSPACE}/.github/tests/test pcb/test_top.png" | |
- name: simple render with output path | |
run: bash PATH="${GITHUB_WORKSPACE}:$PATH" render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" -o "${GITHUB_WORKSPACE}/images" && test -s "${GITHUB_WORKSPACE}/images/top.png" | |
- name: simple render with zoom | |
run: bash PATH="${GITHUB_WORKSPACE}:$PATH" render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" -o "${GITHUB_WORKSPACE}/images" -z "0.5" && test -s "${GITHUB_WORKSPACE}/images/top.png" | |
- name: render with animation | |
run: bash PATH="${GITHUB_WORKSPACE}:$PATH" render-pcb.sh -f "${GITHUB_WORKSPACE}/.github/tests/test pcb/test.kicad_pcb" -o "${GITHUB_WORKSPACE}/images" -a "gif" && test -s "${GITHUB_WORKSPACE}/images/rotating.gif" | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_OUTPUT | |
- name: Build and push Docker image dev | |
if: github.ref_name == 'dev' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
build-args: | | |
"VERSION=${{ github.sha }}-dev" | |
tags: "ghcr.io/linalinn/kicad-render:dev,ghcr.io/linalinn/kicad-render:dev-${{ steps.date.outputs.date }}" | |
- name: Build and push Docker image | |
if: github.ref_name == github.event.repository.default_branch | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
build-args: | | |
"VERSION=${{ github.sha }}" | |
tags: ghcr.io/linalinn/kicad-render:nightly,ghcr.io/linalinn/kicad-render:nightly-${{ steps.date.outputs.date }} |