Switch to single workflow file
All checks were successful
Tests / reset-status (push) Successful in 2s
Tests / tests (push) Successful in 4m50s
Tests / build (push) Successful in 3m42s

This commit is contained in:
karthik 2023-10-28 11:34:28 +02:00
parent 99bd6d15ad
commit 070a7c7c1b
5 changed files with 74 additions and 86 deletions

View File

@ -1,33 +0,0 @@
name: Build
on:
workflow_run:
workflows: ["Tests"]
types:
- completed
jobs:
execute-tests:
runs-on: ubuntu-latest
steps:
- name: Set running
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/${{ gitea.workflow }}","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build
id: build
run: ./gradlew build -x test
- name: Publish status
if: always()
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/${{ gitea.workflow }}","status":"${{ steps.build.conclusion }}"}'

View File

@ -1,18 +0,0 @@
name: Init
on: [push]
jobs:
execute-tests:
runs-on: ubuntu-latest
steps:
- name: Reset test status
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/Tests","status":"starting"}'
- name: Reset build status
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/Build","status":"waiting for test"}'

View File

@ -1,33 +0,0 @@
name: Tests
on:
workflow_run:
workflows: ["Init"]
types:
- completed
jobs:
execute-tests:
runs-on: ubuntu-latest
steps:
- name: Set running
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/${{ gitea.workflow }}","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run tests
id: tests
run: ./gradlew test
- name: Publish status
if: always()
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/${{ gitea.workflow }}","status":"${{ steps.tests.conclusion }}"}'

View File

@ -0,0 +1,72 @@
name: Tests
on: [push]
jobs:
reset-status:
runs-on: ubuntu-latest
steps:
- name: Reset test status
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/tests","status":"starting"}'
- name: Reset build status
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/build","status":"waiting for test"}'
tests:
needs: reset-status
runs-on: ubuntu-latest
steps:
- name: Set test running
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/tests","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run tests
id: tests
run: ./gradlew test
- name: Publish test status
if: always()
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/tests","status":"${{ steps.tests.conclusion }}"}'
build:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Set build running
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/build","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build
id: build
run: ./gradlew build -x test
- name: Publish build status
if: always()
run: |
curl -v -X POST https://barrelsofdata.com/api/v1/git/action/status/publish \
-H 'X-API-KEY: ${{ secrets.STATUS_PUBLISH_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{"action":"${{ gitea.repository }}/action/build","status":"${{ steps.build.conclusion }}"}'

View File

@ -1,5 +1,5 @@
[![Tests](https://barrelsofdata.com/api/v1/git/action/status/fetch/barrelsofdata/spark-boilerplate/Tests)](https://git.barrelsofdata.com/barrelsofdata/spark-boilerplate/actions?workflow=tests.yaml) [![Tests](https://barrelsofdata.com/api/v1/git/action/status/fetch/barrelsofdata/spark-boilerplate/tests)](https://git.barrelsofdata.com/barrelsofdata/spark-boilerplate/actions?workflow=workflow.yaml)
[![Build](https://barrelsofdata.com/api/v1/git/action/status/fetch/barrelsofdata/spark-boilerplate/Build)](https://git.barrelsofdata.com/barrelsofdata/spark-boilerplate/actions?workflow=build.yaml) [![Build](https://barrelsofdata.com/api/v1/git/action/status/fetch/barrelsofdata/spark-boilerplate/build)](https://git.barrelsofdata.com/barrelsofdata/spark-boilerplate/actions?workflow=workflow.yaml)
# Spark Boilerplate # Spark Boilerplate
This is a boilerplate project for Apache Spark. The related blog post can be found at [https://www.barrelsofdata.com/spark-boilerplate-using-scala](https://www.barrelsofdata.com/spark-boilerplate-using-scala) This is a boilerplate project for Apache Spark. The related blog post can be found at [https://www.barrelsofdata.com/spark-boilerplate-using-scala](https://www.barrelsofdata.com/spark-boilerplate-using-scala)