From 9471f6624764237acff8950688e3eaacdf31cd1b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Sat, 12 Oct 2024 15:35:05 +0200 Subject: [PATCH] Split up linting from running tests --- .github/workflows/ci.yml | 26 ++------------------------ .github/workflows/lint.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 212ffad6..eac94282 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,40 +1,18 @@ # This workflow will do a clean install of the dependencies and run tests across different versions # # Requires scripts: -# - bin/run_lints.R # - bin/run_tests.R name: Exercise tests on: push: - branches: [master, main] + branches: [main] pull_request: - branches: [master, main] + branches: [main] workflow_dispatch: jobs: - precheck: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: 4.3.1 - use-public-rspm: true - - - name: Install project dependencies - run: | - install.packages(c("testthat", "jsonlite", "lintr")) - shell: Rscript {0} - - - name: Run exercism/r ci pre-check (checks config, lint code) for all exercises - run: | - source("bin/run_lints.R") - shell: Rscript {0} - ci: runs-on: ubuntu-22.04 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..ca790120 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,35 @@ +# This workflow will do a clean install of the dependencies and run the linter +# +# Requires scripts: +# - bin/run_lints.R + +name: Lint exercises + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 4.3.1 + use-public-rspm: true + + - name: Install project dependencies + run: | + install.packages(c("testthat", "jsonlite", "lintr")) + shell: Rscript {0} + + - name: Run exercism/r ci pre-check (checks config, lint code) for all exercises + run: | + source("bin/run_lints.R") + shell: Rscript {0}