Skip to content

Commit

Permalink
Change build action to run on pull requests (openrndr#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vechro authored and hamoid committed Aug 1, 2022
1 parent 001531d commit 8591f7f
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 61 deletions.
67 changes: 40 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
name: Build
on:
push:
branches:
- master
# Trigger the workflow on any pull request
pull_request:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: ./orx

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Checkout current repository
uses: actions/checkout@v3
with:
path: ./orx

- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Checkout OPENRNDR repository
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: openrndr/openrndr
path: ./openrndr
ref: master
- uses: actions/[email protected]
with:
path: orx

- name: Test glxinfo
run: |
sudo apt-get install -y mesa-utils xvfb
xvfb-run glxinfo
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '16'
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build OPENRNDR snapshot
run: |
cd ./openrndr
./gradlew publishToMavenLocal -Prelease.version=0.5.1-SNAPSHOT
cd ..
distribution: temurin
java-version: 17
cache: gradle

- name: Build OPENRNDR
working-directory: ./openrndr
run: ./gradlew build -Prelease.version=0.5.1-SNAPSHOT publishToMavenLocal

- name: Build ORX
run: |
cd ./orx
./gradlew build
run: ./gradlew build

- name: Collect screenshots without errors
run: xvfb-run ./gradlew collectScreenshots
61 changes: 35 additions & 26 deletions .github/workflows/generate-screenshots.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
name: Generate screenshots
name: Build and generate screenshots
on:
push:
branches:
- master
branches: [ master ]

defaults:
run:
working-directory: ./orx

jobs:
build:
runs-on: ubuntu-20.04
generate_screenshots:
runs-on: ubuntu-latest
steps:
# Get OPENRNDR
- name: Get OPENRNDR HEAD ref
run: echo "OPENRNDR_HEAD=$(git ls-remote https://github.com/openrndr/openrndr HEAD | awk '{print $1}')" >> $GITHUB_ENV
- uses: actions/cache@v2
id: cache_openrndr
- name: Checkout current repository
uses: actions/checkout@v3
with:
path: |
./openrndr
key: ${{ runner.os }}--openrndr-${{ env.OPENRNDR_HEAD }}
- uses: actions/[email protected]
#if: steps.cache_openrndr.outputs.cache-hit != 'true'
path: ./orx

- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Checkout OPENRNDR repository
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: openrndr/openrndr
path: ./openrndr
ref: master
- name: Publish OPENRNDR snapshot
run: |
cd ./openrndr
./gradlew publishToMavenLocal -Prelease.version=0.5.1-SNAPSHOT
cd ..

- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 17
- name: Test glxinfo
run: |
sudo apt install -y mesa-utils xvfb
sudo apt-get install -y mesa-utils xvfb
xvfb-run glxinfo
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
cache: gradle

- name: Build OPENRNDR
working-directory: ./openrndr
run: ./gradlew build -Prelease.version=0.5.1-SNAPSHOT publishToMavenLocal

- name: Build ORX
run: ./gradlew build

- name: Collect screenshots
run: xvfb-run ./gradlew collectScreenshots

- name: Build main readme
run: xvfb-run ./gradlew buildMainReadme

- name: Prepare media branch
run: |
git config --global user.email "[email protected]"
Expand All @@ -57,4 +66,4 @@ jobs:
git add [a-z-]*/images/*.png
cd ..
git commit -m "add auto-generated media"
git push -f origin media
git push -f origin media
9 changes: 5 additions & 4 deletions .github/workflows/release-candidate-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ on:
tags:
- v[0-9].[0-9]+.[0-9]+-rc.[0-9]+
jobs:
build:
runs-on: ubuntu-18.04
release_candidate_to_maven_central:
runs-on: ubuntu-latest
steps:
- name: Get OPENRNDR release tag
run: echo "OPENRNDR_VERSION=$(git ls-remote --refs --tags https://github.com/openrndr/openrndr | cut --delimiter='/' --fields=3 | sort --version-sort | tail --lines=1)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
- name: Build ORX
env:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ on:
- v[0-9].[0-9]+.[0-9]+
- v[0-9].[0-9]+.[0-9]+-[0-9]+
jobs:
build:
runs-on: ubuntu-18.04
release_to_maven_central:
runs-on: ubuntu-latest
steps:
- name: Get OPENRNDR release tag
run: echo "OPENRNDR_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/openrndr/openrndr | cut --delimiter='/' --fields=3 | tail --lines=1)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
- name: Build ORX
env:
Expand Down

0 comments on commit 8591f7f

Please sign in to comment.