Skip to content

Commit

Permalink
Try to extract platforms into env
Browse files Browse the repository at this point in the history
  • Loading branch information
rimrakhimov committed Feb 1, 2024
1 parent 046022d commit 4ce709e
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions .github/workflows/visualizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,42 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install sol2uml
run: |
npm install phantom
npm link [email protected] --only=production
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: visualizer -> target

- name: Unit tests
run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture
if: success() || failure()

- name: Doc tests
run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto
if: success() || failure()

- name: Integration tests
run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture
if: success() || failure()
# - name: Install deps
# uses: ./.github/actions/deps
#
# - uses: actions/setup-node@v3
# with:
# node-version: 16
#
# - name: Install sol2uml
# run: |
# npm install phantom
# npm link [email protected] --only=production
#
# - name: Install toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# override: true
#
# - name: Rust cache
# uses: Swatinem/rust-cache@v2
# with:
# cache-on-failure: true
# workspaces: visualizer -> target
#
# - name: Unit tests
# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture
# if: success() || failure()
#
# - name: Doc tests
# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto
# if: success() || failure()
#
# - name: Integration tests
# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture
# if: success() || failure()

lint:
name: Linting
Expand All @@ -76,27 +76,27 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt, clippy
override: true

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: visualizer -> target

- name: cargo fmt
run: cargo fmt --all -- --check --config imports_granularity=Crate

- name: cargo clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
# - name: Install deps
# uses: ./.github/actions/deps
#
# - name: Install toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# components: rustfmt, clippy
# override: true
#
# - uses: Swatinem/rust-cache@v2
# with:
# cache-on-failure: true
# workspaces: visualizer -> target
#
# - name: cargo fmt
# run: cargo fmt --all -- --check --config imports_granularity=Crate
#
# - name: cargo clippy
# run: cargo clippy --all --all-targets --all-features -- -D warnings

push:
name: Docker build and docker push
Expand Down Expand Up @@ -143,14 +143,14 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
env:
PLATFORMS: linux/amd64
with:
context: "visualizer"
file: "visualizer/Dockerfile"
push: ${{ steps.tags_extractor.outputs.tags != '' }}
tags: ${{ steps.tags_extractor.outputs.tags }}
platforms: |
linux/amd64
linux/arm64/v8
platforms: ${{ PLATFORMS }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache
cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }}

0 comments on commit 4ce709e

Please sign in to comment.