From 5950e7d2921556e88cc55a51ba9b2bd0260845d7 Mon Sep 17 00:00:00 2001 From: Thomas Deblock Date: Fri, 3 Jun 2022 17:01:01 +0200 Subject: [PATCH] ci: split actions - use one action to check PR build - use one action to check that there is no breaking change --- .github/workflows/pr-check.yml | 20 ++++++++++++++++++++ .github/workflows/test.yml | 15 --------------- 2 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/pr-check.yml diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 00000000..b533d836 --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,20 @@ +name: PR check + +on: + pull_request: + +jobs: + check-build-files-in-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: npm ci + - run: npm run build + - name: Confirm new build included in commit + # language=bash + run: | + # Confirm that the dist was built, and changes included in the commit + if [ $(git status --porcelain dist/index.js | wc -l) -eq "1" ]; then + echo "::error title=Build not committed::Running 'npm run build' changes 'dist/index.js' - build locally and add changes to commit." + exit 1 + fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 390e12f1..23704b05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,21 +8,6 @@ on: workflow_dispatch: jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: npm ci - - run: npm run build - - name: Confirm new build included in commit - # language=bash - run: | - # Confirm that the dist was built, and changes included in the commit - if [ $(git status --porcelain dist/index.js | wc -l) -eq "1" ]; then - echo "::error title=Build not committed::Running 'npm run build' changes 'dist/index.js' - build locally and add changes to commit." - exit 1 - fi - direct-from-repository-test: runs-on: ubuntu-latest steps: