Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

FM-186: Publish docker image #428

FM-186: Publish docker image

FM-186: Publish docker image #428

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
# Check code formatting; anything that doesn't require compilation.
pre-compile-checks:
name: Pre-compile checks
runs-on: ubuntu-latest
steps:
- name: Check out the project
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
- name: Check code formatting
run: make check-fmt
- name: Check license headers
run: make license
# Test matrix, running tasks from the Makefile.
tests:
if: github.ref == 'refs/heads/main'
needs: [pre-compile-checks]
name: ${{ matrix.make.name }} (${{ matrix.os }}, ${{ matrix.rust }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust: [stable, nightly]
make:
- name: Lint
task: lint
- name: Test
task: test
- name: End-to-End
task: e2e
exclude:
- rust: stable
make:
name: Lint
- rust: nightly
make:
name: End-to-end
env:
RUST_BACKTRACE: full
RUSTFLAGS: -Dwarnings
CARGO_INCREMENTAL: '0'
SCCACHE_CACHE_SIZE: 10G
CC: "sccache clang"
CXX: "sccache clang++"
PROFILE: "ci"
steps:
- name: Check out the project
uses: actions/checkout@v3
- name: Install Tools
uses: ./.github/actions/install-tools
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Cache
uses: ./.github/actions/setup-cache
timeout-minutes: 5
continue-on-error: true
with:
name: ${{ matrix.make.name }}
os: ${{ matrix.os }}
rust: ${{ matrix.rust }}
- name: ${{ matrix.make.name }}
run: make ${{ matrix.make.task }}
# Publish Docker image on the main branch
docker-publish:
name: Publish Docker Image
# needs: [tests]
# if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Check out the project
uses: actions/checkout@v3
- name: Install Tools
uses: ./.github/actions/install-tools
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Try to reuse the cache from the tests which built the docker image already.
- name: Setup Cache
uses: ./.github/actions/setup-cache
timeout-minutes: 5
continue-on-error: true
with:
name: e2e
os: ubuntu-latest
rust: stable
- name: Docker Build
run: make docker-build
- name: Docker Push
uses: ./.github/actions/docker-push
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-owner: ${{ github.repository_owner }}
image-name: ${{ github.event.repository.name }}