apache-beam-examples/.gitea/workflows/workflow.yaml
karthik 2d328743ff
All checks were successful
Tests / reset-status (push) Successful in 3s
Tests / tests (push) Successful in 8m42s
Tests / integration-tests (push) Successful in 6m34s
Tests / build (push) Successful in 8m25s
Update versions and switch to java 21
2023-12-15 08:10:50 +01:00

105 lines
4.3 KiB
YAML

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 integration 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/integration-tests","status":"waiting for test"}'
- 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 integration 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: '21'
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 }}"}'
integration-tests:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Set integration 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/integration-tests","status":"running"}'
- name: Checkout
uses: actions/checkout@v4
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Run integration tests
id: integration-tests
run: ./gradlew integrationTest
- name: Publish integration 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/integration-tests","status":"${{ steps.integration-tests.conclusion }}"}'
build:
needs: integration-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: '21'
distribution: 'temurin'
- name: Build
id: build
run: ./gradlew build -x check
- 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 }}"}'