Repository navigation
test: add pre-installed packages to Docker image #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: Test Docker Image Build | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - 'Dockerfile' | |
| - '.github/workflows/test-docker-image.yaml' | |
| jobs: | |
| build-test-image: | |
| name: Build Test Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set lowercase owner | |
| run: echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push test image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ env.OWNER }}/github-runner:test | |
| ghcr.io/${{ env.OWNER }}/github-runner:test-${{ github.sha }} | |
| verify-tools: | |
| name: Verify Pre-installed Tools | |
| needs: build-test-image | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/${{ github.repository_owner }}/github-runner:test | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Verify Atmos installation | |
| run: | | |
| echo "Checking Atmos..." | |
| atmos version | |
| which atmos | |
| - name: Verify Terraform installation | |
| run: | | |
| echo "Checking Terraform..." | |
| terraform version | |
| which terraform | |
| - name: Verify tfcmt installation | |
| run: | | |
| echo "Checking tfcmt..." | |
| tfcmt --version | |
| which tfcmt | |
| - name: Verify terraform-docs installation | |
| run: | | |
| echo "Checking terraform-docs..." | |
| terraform-docs --version | |
| which terraform-docs | |
| - name: Verify all tools are in PATH | |
| run: | | |
| echo "All tools verified successfully!" | |
| echo "✅ Atmos: $(atmos version | head -n 1)" | |
| echo "✅ Terraform: $(terraform version | head -n 1)" | |
| echo "✅ tfcmt: $(tfcmt --version)" | |
| echo "✅ terraform-docs: $(terraform-docs --version)" | |
| - name: Summary | |
| if: success() | |
| run: | | |
| echo "🎉 All pre-installed tools are working correctly!" | |
| echo "The Docker image is ready to use and will avoid GitHub API rate limits." |