diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index ec490711d..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build - -on: - pull_request: - push: - branches: - - main - workflow_dispatch: - -defaults: - run: - working-directory: exercises - -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 diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml new file mode 100644 index 000000000..615137164 --- /dev/null +++ b/.github/workflows/java.yml @@ -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() diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index b2b55492d..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Lint - -on: - pull_request: - push: - branches: - - main - workflow_dispatch: - -permissions: - contents: read - -jobs: - java: - 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 - - markdown: - name: Lint Markdown files - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Lint markdown - uses: DavidAnson/markdownlint-cli2-action@510b996878fc0d1a46c8a04ec86b06dbfba09de7 diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml new file mode 100644 index 000000000..c195f7613 --- /dev/null +++ b/.github/workflows/markdown.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index dc26d9d5d..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Test - -on: - pull_request: - push: - branches: - - main - workflow_dispatch: - -jobs: - 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()