adding debbuging commands #510
This file contains 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: Docker | |
on: | |
push: | |
jobs: | |
main: | |
strategy: | |
matrix: | |
include: | |
- unity_docker_image: unityci/editor:2022.3.12f1-webgl-3.0.0 | |
service_name: asset-bundle-converter | |
platform_target: webgl | |
- unity_docker_image: unityci/editor:2022.3.12f1-windows-mono-3.0.0 | |
service_name: asset-bundle-converter-windows | |
platform_target: windows | |
- unity_docker_image: unityci/editor:2022.3.12f1-mac-mono-3.0.0 | |
service_name: asset-bundle-converter-mac | |
platform_target: mac | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remove unused Haskell GHC CodeQL Julia Chromium | |
run: | | |
sudo apt-get remove -y ghc haskell-platform julia | |
sudo apt-get autoremove -y | |
sudo rm -rf /usr/local/.ghcup | |
sudo rm -rf /usr/local/bin/ghcup | |
sudo rm -rf /opt/hostedtoolcache/CodeQL | |
sudo rm -rf /usr/local/julia1.10.4 | |
sudo rm -rf /usr/local/share/chromium | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
lfs: true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Build Image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ matrix.service_name }} | |
# layers: true | |
tags: next ${{ github.sha }} ${{ inputs.docker-tag }} | |
dockerfiles: | | |
./Dockerfile | |
build-args: | | |
COMMIT_HASH=${{ github.sha }} | |
UNITY_DOCKER_IMAGE=${{ matrix.unity_docker_image }} | |
PLATFORM_TARGET=${{ matrix.platform_target }} | |
- name: Debugging | |
run: | | |
echo "Image: ${{ matrix.service_name }}" | |
echo "Tags: next ${{ github.sha }} ${{ inputs.docker-tag }}" | |
echo "Build Args: COMMIT_HASH=${{ github.sha }} UNITY_DOCKER_IMAGE=${{ matrix.unity_docker_image }} PLATFORM_TARGET=${{ matrix.platform_target }}" | |
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10 | |
buildah images | |
docker images | |
df -h | |
docker system df | |
sudo du -sh /var/lib/containers/ | |
for img in $(buildah images -q --filter=reference=docker.io/unityci/editor) $(buildah images -q --filter=reference=docker.io/library/node); do | |
buildah rmi $img | |
done | |
sudo apt-get purge google-chrome-stable microsoft-edge-stable -y && sudo apt-get autoremove -y | |
docker image prune -af | |
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10 | |
buildah images | |
df -h | |
docker system df | |
sudo du -sh /var/lib/containers/ | |
docker info | |
buildah info | |
buildah push localhost/${{ matrix.service_name }}:${{ github.sha }} docker-archive:temp.tar | |
docker load -i temp.tar | |
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10 | |
df -h | |
docker system df | |
rm -f temp.tar | |
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10 | |
df -h | |
docker images | |
docker history --no-trunc localhost/${{ matrix.service_name }}:${{ github.sha }} | |
- name: Create $(pwd)/tmp/Unity/Unity_lic.ulf | |
run: mkdir -p $(pwd)/tmp/Unity && echo "$UNITY_2021_ULF" > $(pwd)/tmp/Unity/Unity_lic.ulf | |
env: | |
UNITY_2021_ULF: ${{ secrets.UNITY_2021_ULF }} | |
- name: Run tests | |
run: | | |
docker run --rm \ | |
-v $(pwd)/tmp/Unity:/root/.local/share/unity3d/Unity \ | |
-v $(pwd):/app \ | |
localhost/${{ matrix.service_name }}:${{ github.sha }} \ | |
sh -c "cd /app ; ls -la ; chmod +x ci-editmode-test.sh ; ./ci-editmode-test.sh" | |
- name: Run test conversion of urn:decentraland:off-chain:base-avatars:brown_pants | |
run: | | |
docker run --rm \ | |
-v $(pwd)/tmp/Unity:/root/.local/share/unity3d/Unity \ | |
localhost/${{ matrix.service_name }}:${{ github.sha }} \ | |
node --trace-warnings --abort-on-uncaught-exception --unhandled-rejections=strict dist/test-conversion.js \ | |
--baseUrl https://peer.decentraland.org/content \ | |
--pointer urn:decentraland:off-chain:base-avatars:brown_pants \ | |
--outDir /tmp-ab \ | |
--logFile /tmp-ab/log.txt | |
- name: Push To quay.io | |
id: push-to-quay | |
uses: redhat-actions/push-to-registry@v2 | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
# tags: ${{ steps.build-image.outputs.tags }} | |
tags: ${{ github.sha }} | |
registry: quay.io/decentraland | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_TOKEN }} | |
- name: Print image url | |
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
- name: Trigger deployment | |
id: deploy | |
uses: decentraland/dcl-deploy-action@main | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
dockerImage: quay.io/decentraland/${{ matrix.service_name }}:${{ github.sha }} | |
serviceName: ${{ matrix.service_name }} | |
env: dev prd | |
token: ${{ secrets.GITHUB_TOKEN }} |