Skip to content

Commit

Permalink
Only run applicable GHA workflows on PRs (#2697)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderploegsma authored Jan 31, 2024
1 parent a2b3115 commit cde57b5
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 83 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/build.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Java

on:
pull_request:
paths:
- "**/*.java"
- "**/*.gradle"
push:
branches:
- main
workflow_dispatch:

jobs:
build:
name: Check if tests compile cleanly with starter sources
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 1.17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: 17
distribution: "temurin"
- name: Check if tests compile cleanly with starter sources
run: ./gradlew compileStarterTestJava --continue
working-directory: exercises

lint:
name: Lint Java files using Checkstyle
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 1.17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: 17
distribution: "temurin"
- name: Run checkstyle
run: ./gradlew check --exclude-task test --continue
working-directory: exercises

test:
name: Test all exercises using java-test-runner
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Test all exercises using java-test-runner
run: bin/test-with-test-runner
- name: Archive test results
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: test-results
path: exercises/**/build/results.json
if: failure()
34 changes: 0 additions & 34 deletions .github/workflows/lint.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Markdown

on:
pull_request:
paths:
- "**/*.md"
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
name: Lint Markdown files
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@510b996878fc0d1a46c8a04ec86b06dbfba09de7
23 changes: 0 additions & 23 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit cde57b5

Please sign in to comment.