Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

git config --global advice.detachedHead false

(
cd .github
git clone --depth 1 --branch "${ENTANDO_GITHUB_TOOLS_VERSION}" "${ENTANDO_GITHUB_TOOLS_REPO}" &>/dev/null
)

. .github/github-tools/lib.sh

configure.start "$1"

if [[ "$GITHUB_REF" == refs/tags/* ]]; then
. .github/github-tools/base.configure --tag "$GITHUB_REF"
else
. .github/github-tools/base.configure "$GH_PR_TITLE" "$GH_PR_NUMBER"
fi

configure.complete
91 changes: 70 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
name: Rust

on: [push, pull_request]
name: CDS MultiModule PR

env:
ENTANDO_GITHUB_TOOLS_VERSION: "v0.1.1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PR_TITLE: ${{ github.event.pull_request.title }}
GH_PR_NUMBER: ${{ github.event.pull_request.number }}
GH_PR_RUN_NUMBER: ${{ github.run_number }}
IMAGES_TO_BUILD: "Dockerfile:cds"
ENTANDO_CRANE_VERSION: ${{ vars.ENTANDO_CRANE_VERSION || 'v0.10.0' }}
GITHUB_REF: ${{ github.ref }}
CARGO_TERM_COLOR: always

on:
push:
branches: [ "develop", "release/*" ]
tags: [ 'v*' ]
pull_request:
branches: [ "develop", "release/*", "main", "entando*" ]

jobs:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test:
name: Test
runs-on: ubuntu-latest
Expand All @@ -19,22 +33,22 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test

# fmt:
# name: Rustfmt
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# components: rustfmt
# - uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --all -- --check

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# fmt:
# name: Rustfmt
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# components: rustfmt
# - uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --all -- --check
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clippy:
name: Clippy
runs-on: ubuntu-latest
Expand All @@ -49,7 +63,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coverage:
name: Code coverage
runs-on: ubuntu-latest
Expand All @@ -69,4 +83,39 @@ jobs:

# This runs tarpaulin to generate the coverage report.
- name: Run tarpaulin
run: cargo tarpaulin --ignore-tests
run: cargo tarpaulin --ignore-tests
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
publish:
permissions:
contents: read
pull-requests: write

runs-on: ubuntu-latest
needs: [test, clippy]

steps:
- uses: actions/checkout@v4

- name: Configure
run: if [ -f ".github/configure" ]; then . .github/configure "publish"; fi

- name: Build Docker image
run: |
.github/github-tools/docker.multiBuild \
"${IMAGES_TO_BUILD}" \
"${ARTIFACT_VERSION}" \
"${{ vars.DOCKER_ORG }}" \
;

- name: Publish Docker image
run: |
GH_DO_COMMENT=true \
.github/github-tools/docker.multiPublish \
"${IMAGES_TO_BUILD}" \
"${ARTIFACT_VERSION}" \
"${{ vars.DOCKER_ORG }}" \
"${{ vars.DOCKER_REGISTRY }}" \
"${{ secrets.DOCKER_USERNAME }}" \
"${{ secrets.DOCKER_PASSWORD }}" \
"${ARTIFACT_PUB_TYPE}" \
;
Loading