Added test workflow. #1
This file contains hidden or 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 and release | |
| env: | |
| CI: false | |
| IMAGE_TAG: latest | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Determine Docker image tag | |
| id: docker_tag | |
| run: | | |
| IMAGE_NAME="rav3nh01m/micropython_esp-idf:$IMAGE_TAG" | |
| echo "Checking for image: $IMAGE_NAME" | |
| if docker pull "$IMAGE_NAME"; then | |
| echo "Using tag: $IMAGE_TAG" | |
| else | |
| echo "Tag not found. Falling back to latest." | |
| IMAGE_TAG="latest" | |
| docker pull "rav3nh01m/micropython_esp-idf:latest" | |
| fi | |
| echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT | |
| - name: Get runner UID and GID | |
| id: runner_ids | |
| run: | | |
| echo "uid=$(id -u)" >> "$GITHUB_OUTPUT" | |
| echo "gid=$(id -g)" >> "$GITHUB_OUTPUT" | |
| - name: Run MicroPython build container | |
| run: | | |
| docker run --rm \ | |
| -e HOST_UID=${{ steps.runner_ids.outputs.uid }} \ | |
| -e HOST_GID=${{ steps.runner_ids.outputs.gid }} \ | |
| -e PROJECT_DIR=/project \ | |
| -e PORT=${{ vars.PORT }} \ | |
| -e BOARD=${{ vars.BOARD }} \ | |
| -e FREEZE_BOOT=${{ vars.FREEZE_BOOT }} \ | |
| -e FREEZE_MAIN=${{ vars.FREEZE_MAIN }} \ | |
| -v "$PWD:/project" \ | |
| rav3nh01m/micropython:${{ steps.docker_tag.outputs.image_tag }} |