diff --git a/.github/workflows/test-pr-arm64.yaml b/.github/workflows/test-pr-arm64.yaml new file mode 100644 index 000000000..d82ec3409 --- /dev/null +++ b/.github/workflows/test-pr-arm64.yaml @@ -0,0 +1,67 @@ +name: "PR - Test Updated Features (arm64)" +on: + pull_request: + # NOTE: To extend this workflow to other features, add path entries below + # following the same pattern, e.g.: + # - "src//**" + # - "test//**" + paths: + - "src/powershell/**" + - "test/powershell/**" + +jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + features: ${{ steps.filter.outputs.changes }} + steps: + - uses: dorny/paths-filter@v3 + id: filter + with: + # NOTE: To extend this workflow to other features, add filter entries below + # following the same pattern, e.g.: + # : ./**//** + filters: | + powershell: ./**/powershell/** + + test: + needs: [detect-changes] + runs-on: ubuntu-24.04-arm + continue-on-error: true + strategy: + matrix: + features: ${{ fromJSON(needs.detect-changes.outputs.features) }} + baseImage: + [ + "ubuntu:focal", + "ubuntu:jammy", + "debian:11", + "debian:12", + "mcr.microsoft.com/devcontainers/base:ubuntu", + "mcr.microsoft.com/devcontainers/base:debian", + "mcr.microsoft.com/devcontainers/base:noble" + ] + steps: + - uses: actions/checkout@v4 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" + run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . + + test-scenarios: + needs: [detect-changes] + runs-on: ubuntu-24.04-arm + continue-on-error: true + strategy: + matrix: + features: ${{ fromJSON(needs.detect-changes.outputs.features) }} + steps: + - uses: actions/checkout@v4 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Testing '${{ matrix.features }}' scenarios" + run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated . diff --git a/src/powershell/devcontainer-feature.json b/src/powershell/devcontainer-feature.json index 2f511b212..3b500608d 100644 --- a/src/powershell/devcontainer-feature.json +++ b/src/powershell/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "powershell", - "version": "2.0.0", + "version": "2.0.1", "name": "PowerShell", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/powershell", "description": "Installs PowerShell along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.", diff --git a/src/powershell/install.sh b/src/powershell/install.sh index c12b72b75..40308c32e 100755 --- a/src/powershell/install.sh +++ b/src/powershell/install.sh @@ -367,7 +367,7 @@ install_using_github() { # Fall back on direct download if no apt package exists in microsoft pool if command -v apt-get > /dev/null 2>&1; then # Debian/Ubuntu dependencies - check_packages curl ca-certificates gnupg2 dirmngr libc6 libgcc1 libgssapi-krb5-2 libstdc++6 libunwind8 libuuid1 zlib1g libicu[0-9][0-9] + check_packages curl ca-certificates gnupg2 dirmngr libc6 libgcc1 libgssapi-krb5-2 libstdc++6 libunwind8 libuuid1 zlib1g libicu[0-9][0-9] wget elif command -v dnf > /dev/null 2>&1; then # AlmaLinux/RHEL dependencies check_packages curl ca-certificates gnupg2 glibc libgcc krb5-libs libstdc++ libuuid zlib libicu wget tar @@ -394,10 +394,10 @@ install_using_github() { install_prev_pwsh $pwsh_url fi - # downlaod the latest version of powershell and extracting the file to powershell directory + # download the latest version of powershell and extracting the file to powershell directory wget https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/${powershell_filename} mkdir ~/powershell - tar -xvf powershell-${POWERSHELL_VERSION}-linux-x64.tar.gz -C ~/powershell + tar -xvf ${powershell_filename} -C ~/powershell powershell_archive_sha256="$(cat release.html | tr '\n' ' ' | sed 's|<[^>]*>||g' | grep -oP "${powershell_filename}\s+\K[0-9a-fA-F]{64}" || echo '')" if [ -z "${powershell_archive_sha256}" ]; then