Skip to content

reuse actions

reuse actions #2

name: Paladin Core Build
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
# Install protoc only on non-Windows systems
- name: Install protoc
run: |
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v25.1/protoc-25.1-linux-x86_64.zip
unzip protoc-25.1-linux-x86_64.zip -d protoc
echo "${PWD}/protoc/bin" >> $GITHUB_PATH
# Set up Java
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
# Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
check-latest: true
cache-dependency-path: |
**/*.sum
# Set up Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
# Build with Gradle
# This does not build any docker images, and does not run any dockerized tests.
# It does run Go/Java/Solidity component and integration tests that use PostgreSQL and Besu
- name: Build with Gradle
run: ./gradlew -PcomposeLogs=true -PverboseTests=true --no-daemon --parallel --max-workers=5 build
image-build:
# run only on PRs
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
env:
IMAGE: paladin
REGISTRY: paladin.io
IMAGE_TAG: ${{ github.sha }}
steps:
- name: build image
uses: ./.github/actions/build-image.yaml
with:
dockerfile: ./Dockerfile
registry: ${{ env.REGISTRY }}
image: ${{ env.IMAGE }}
image_tag: ${{ env.IMAGE_TAG }}
push: false
platforms: linux/amd64
runs-on: ubuntu-latest
- name: Save Docker image as artifact
run: docker save ${{ env.REGISTRY }}/${{ env.IMAGE }} -o paladin-image.tar
# This will allow using the image in other jobs
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: paladin-image
path: paladin-image.tar
image-release:
# run only on pushes to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ./.github/actions/cross-build-images.yaml

Check failure on line 84 in .github/workflows/paladin-PR-build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/paladin-PR-build.yml

Invalid workflow file

invalid value workflow reference: no version specified
with:
registry: ghcr.io
repository: ${{ github.repository_owner }}
image_tag: ${{ github.ref_name }}
secrets:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}