Remove rust environment by default #69
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: pr | |
| on: | |
| pull_request: | |
| branches: | |
| - v1.x | |
| - v2.x | |
| - v3.x | |
| - v4.x | |
| jobs: | |
| stage1: | |
| name: Stage 1 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| UUID: ${{ steps.export_container_uuid.outputs.UUID }} | |
| steps: | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push toolchain | |
| run: ./scripts/build -g -s toolchain | |
| - name: Export the container | |
| id: export_container_uuid | |
| run: | | |
| export DEBIAN_FRONTEND=noninteractive | |
| sudo apt-get update -y | |
| sudo apt-get install uuid-runtime | |
| export UUID=$(uuidgen) | |
| echo "UUID=$UUID" >> "$GITHUB_ENV" | |
| echo "UUID=$UUID" >> "$GITHUB_OUTPUT" | |
| docker image save ghcr.io/toltec-dev/toolchain | gzip > ${{ runner.temp }}/$UUID-toolchain.tar.gz | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.UUID }}-toolchain | |
| path: ${{ runner.temp }}/${{ env.UUID }}-toolchain.tar.gz | |
| retention-days: 1 | |
| stage2: | |
| name: Stage 2 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| UUID: ${{ steps.export_uuid_for_stage3.outputs.UUID }} | |
| needs: stage1 | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ needs.stage1.outputs.UUID }}-toolchain | |
| path: ${{ runner.temp }} | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set UUID for stage3 | |
| id: export_uuid_for_stage3 | |
| run: echo "UUID=${{ needs.stage1.outputs.UUID }}" >> "$GITHUB_OUTPUT" | |
| - name: Import container | |
| run: | | |
| pushd ${{ runner.temp }} | |
| tar xf ${{ needs.stage1.outputs.UUID }}-toolchain.tar.gz | |
| popd | |
| rm ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-toolchain.tar.gz | |
| - name: Build and push toolchain | |
| run: ./scripts/build -g -s base -c ghcr.io/toltec-dev/toolchain=oci-layout://${{ runner.temp }} | |
| - name: Export the container | |
| run: docker image save ghcr.io/toltec-dev/base | gzip > ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-base.tar.gz | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ needs.stage1.outputs.UUID }}-base | |
| path: ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-base.tar.gz | |
| retention-days: 1 | |
| stage3: | |
| name: Stage 3 | |
| runs-on: ubuntu-latest | |
| needs: | |
| - stage1 | |
| - stage2 | |
| strategy: | |
| matrix: | |
| target: [golang, python, qt, rust, dotnet6] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ needs.stage2.outputs.UUID }}-base | |
| path: ${{ runner.temp }} | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Import container | |
| run: | | |
| pushd ${{ runner.temp }} | |
| tar xf ${{ needs.stage2.outputs.UUID }}-base.tar.gz | |
| popd | |
| rm ${{ runner.temp }}/${{ needs.stage2.outputs.UUID }}-base.tar.gz | |
| - name: Build and push toolchain | |
| run: ./scripts/build -g -s ${{ matrix.target }} -c ghcr.io/toltec-dev/base=oci-layout://${{ runner.temp }} | |
| - name: Export the container | |
| run: docker image save ghcr.io/toltec-dev/${{ matrix.target }} | gzip > ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-${{ matrix.target }}.tar.gz | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ needs.stage1.outputs.UUID }}-${{ matrix.target }} | |
| path: ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-${{ matrix.target }}.tar.gz | |
| retention-days: 1 |