Only set proxy environment variables in proxy environments #239
Workflow file for this run
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
| --- | |
| # ******************************************************************************* | |
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | |
| # | |
| # See the NOTICE file(s) distributed with this work for additional | |
| # information regarding copyright ownership. | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Apache License Version 2.0 which is available at | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # ******************************************************************************* | |
| name: Validate DevContainer | |
| description: This workflow is checking that updates do not break stuff. If on main branch, publish to "latest" tag. | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [arm64, amd64] | |
| include: | |
| - os: amd64 | |
| name: DevContainer (amd64) | |
| runner: ubuntu-24.04 | |
| - os: arm64 | |
| name: DevContainer (arm64) | |
| runner: ubuntu-24.04-arm | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout (GitHub) | |
| 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 }} | |
| # Use .devcontainer from THIS repo for building and testing | |
| - name: Check, Build, Test, Publish | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| # The .devcontainer is never published as pre-built container. | |
| # We want to only use it for building and testing the actual container, which resides in src/s-core-devcontainer. | |
| push: never | |
| runCmd: | | |
| set -eux pipefail | |
| # Check | |
| pre-commit run --show-diff-on-failure --color=always --all-files || exit 1 | |
| # Create builder for multi-arch builds | |
| ./scripts/create_builder.sh | |
| # Build | |
| ./scripts/build.sh --${{ matrix.os }} "main" | |
| # Test | |
| ./scripts/test.sh | |
| # Optionally: Publish | |
| # We do not use the push feature of devcontainers/ci here, since that would push the wrong container. | |
| # Instead, we use the publish script which pushes the correct container (residing in src/s-core-devcontainer). | |
| if [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| # manually login to ghcr.io for publishing | |
| echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| ./scripts/publish.sh --${{ matrix.os }} "main" | |
| fi | |
| merge: | |
| name: Merge Labels (main only) | |
| needs: [build] | |
| runs-on: ubuntu-24.04 | |
| if: github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout (GitHub) | |
| 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 }} | |
| # Use .devcontainer from THIS repo for building and testing | |
| - name: Merge | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| # The .devcontainer is never published as pre-built container. | |
| # We want to only use it for building and testing the actual container, which resides in src/s-core-devcontainer. | |
| push: never | |
| runCmd: | | |
| set -eux pipefail | |
| # Merge | |
| # We do not use the push feature of devcontainers/ci here, since that would push the wrong container. | |
| # Instead, we use the publish script which pushes the correct container (residing in src/s-core-devcontainer). | |
| # manually login to ghcr.io for publishing | |
| echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| ./scripts/merge.sh "main" |