diff --git a/.github/workflows/docker_builds.yml b/.github/workflows/docker_build_test.yml similarity index 56% rename from .github/workflows/docker_builds.yml rename to .github/workflows/docker_build_test.yml index 391583b7..d17a4e8b 100644 --- a/.github/workflows/docker_builds.yml +++ b/.github/workflows/docker_build_test.yml @@ -1,4 +1,4 @@ -name: ๐Ÿณ Docker builds +name: ๐Ÿณ Docker builds and test on: workflow_call: secrets: @@ -13,7 +13,7 @@ concurrency: jobs: build-images: - name: Build images + name: Build images and test runs-on: ubuntu-22.04 steps: - name: Checkout sources @@ -28,14 +28,14 @@ jobs: uses: redhat-actions/buildah-build@v2 with: image: godot-explorer - tags: ${{ github.sha }} + tags: latest ${{ github.sha }} dockerfiles: | ./Dockerfile build-args: | - ${{ inputs.build-args }} COMMIT_HASH=${{ github.sha }} - name: Push To quay.io + if: github.ref == 'refs/heads/main' # TODO: Push only on tags / releases? id: push-to-quay uses: redhat-actions/push-to-registry@v2 with: @@ -45,5 +45,23 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_TOKEN }} - - name: Print image url - run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" \ No newline at end of file + - name: Run avatar test + run: | + mkdir -p output + podman run --rm -v \ + $(pwd)/tests/avatars-test-input.json:/app/avatars.json \ + -v $(pwd)/output:/app/output localhost/godot-explorer:latest + + - name: Compare images with snapshots + run: | + cargo run -- compare-image-folders \ + --snapshots tests/snapshots/avatar-image-generation/ \ + --result ${{ github.workspace }}/output/ + + - name: Upload artifacts + if: success() || failure() + uses: actions/upload-artifact@v4 + with: + name: avatar-snapshots + path: | + ${{ github.workspace }}/output/**/* \ No newline at end of file diff --git a/.github/workflows/docker_tests.yml b/.github/workflows/docker_tests.yml index b08424d6..e69de29b 100644 --- a/.github/workflows/docker_tests.yml +++ b/.github/workflows/docker_tests.yml @@ -1,31 +0,0 @@ -name: ๐Ÿงช Docker tests -on: - workflow_call: - -concurrency: - group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}-docker-tests - cancel-in-progress: true - -jobs: - test-image: - name: Test Docker image - runs-on: ubuntu-22.04 - - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Run avatar test - run: | - mkdir -p output - docker run --rm \ - -v $(pwd)/tests/avatars-test-input.json:/app/avatars.json \ - -v $(pwd)/output:/app/output \ - quay.io/decentraland/godot-explorer:${{ github.sha }} - - - name: Compare images with snapshots - run: | - ls -la output/ - cargo run -- compare-image-folders \ - --snapshots tests/snapshots/avatar-image-generation/ \ - --result ${{ github.workspace }}/output/ \ No newline at end of file diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 23fdfaee..34935a54 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -28,11 +28,10 @@ jobs: - name: Install dependencies uses: ./.github/actions/install-deps - - name: Install + # Build section + - name: Cargo install run: cargo run -- install - - # Build section - name: Build working-directory: lib run: cargo build --release diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 1c3c0e4b..a70d15d5 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -26,10 +26,10 @@ jobs: - name: Install dependencies uses: ./.github/actions/install-deps - - name: Install + # Build section + - name: Cargo install run: cargo run -- install - # Build section - name: Build working-directory: lib run: cargo build --release diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index 88d27140..3d0e087f 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -41,17 +41,11 @@ jobs: needs: static-checks uses: ./.github/workflows/windows_builds.yml - # Third stage: Extra ci - docker-build: - name: ๐Ÿณ Docker builds + # Third stage: Extras + docker-build-test: + name: ๐Ÿณ Docker builds and test needs: linux-build - uses: ./.github/workflows/docker_builds.yml - if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/docker_build_test.yml secrets: QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} - - docker-tests: - name: ๐Ÿงช Docker tests - needs: docker-build - uses: ./.github/workflows/docker_tests.yml \ No newline at end of file diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 99f6fe3f..8e45a483 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -29,11 +29,10 @@ jobs: - name: Install dependencies uses: ./.github/actions/install-deps - - name: Install + # Build section + - name: Cargo install run: cargo run -- install - - # Build section - name: Build working-directory: lib run: cargo build --release