Skip to content

Commit

Permalink
improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman committed Jan 9, 2025
1 parent f06ad09 commit ca42c7f
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions .github/workflows/queue_and_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,32 +99,15 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2024-06-14
components: rustfmt
cache: true
- run: just fmt

build:
if: ${{ github.event_name == 'pull_request' }}
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@just
- uses: rui314/setup-mold@v1
- uses: heliaxdev/setup-protoc@v2
with:
version: "25.0"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: true
- run: just build
- run: just fmt-check

docker:
name: Docker
runs-on: ubuntu-latest
if: ${{ github.event_name == 'merge_group' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/1.0.0-maint' }}
if: ${{ github.event_name == 'merge_group' || github.event_name == 'pull_request' }}
env:
GIT_LFS_SKIP_SMUDGE: 1
REGISTRY_URL: ghcr.io
Expand All @@ -149,6 +132,18 @@ jobs:
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_URL }}/anoma/namada-indexer
flavor: |
latest=auto
prefix=${{ matrix.docker.image }}
suffix=
tags: |
type=ref,event=branch,prefix=${{ matrix.docker.image }}-branch-
type=ref,event=pr,prefix=${{ matrix.docker.image }}-pr-
- name: Login to GHCR
uses: docker/login-action@v3
with:
Expand All @@ -161,15 +156,15 @@ jobs:
with:
context: .
file: Dockerfile
build-args: PACKAGE=${{matrix.docker.package}}
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ env.REGISTRY_URL }}/anoma/namada-indexer:${{ matrix.docker.image }}-main
build-args: PACKAGE=${{ matrix.docker.package }}
push: ${{ github.event.pull_request.head.repo.full_name == 'anoma/namada-indexer' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

can_enqueue:
needs: [clippy, format, build, validate-swagger]
needs: [clippy, format, docker, validate-swagger]
if: always() && github.event_name != 'merge_group'
permissions:
actions: read
Expand Down Expand Up @@ -199,5 +194,4 @@ jobs:
run: |
echo "ALL_SUCCESS=$(echo "$NEEDS_JSON" | jq '. | to_entries | map([.value.result == "success", .value.result == "skipped"] | any) | all')" >> $GITHUB_ENV
- name: check outcomes
run: "[ $ALL_SUCCESS == true ]"

run: "[ $ALL_SUCCESS == true ]"

0 comments on commit ca42c7f

Please sign in to comment.