From 7c15626d4d4b51b81c825f0891994b20aa74cef5 Mon Sep 17 00:00:00 2001 From: MatteoPologruto Date: Wed, 17 May 2023 10:06:51 +0200 Subject: [PATCH] Add CI workflow to run integration tests On every push and pull request that affects relevant files, run the integration tests. --- .github/workflows/test-integration.yml | 46 ++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/test-integration.yml diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml new file mode 100644 index 0000000..8e71245 --- /dev/null +++ b/.github/workflows/test-integration.yml @@ -0,0 +1,46 @@ +name: Integration Tests + +on: + pull_request: + push: + schedule: # Scheduled trigger checks for breakage caused by changes to create-changelog + # run every Tuesday at 3 AM UTC + - cron: "0 3 * * 2" + # workflow_dispatch event allows the workflow to be triggered manually + # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # repository_dispatch event allows the workflow to be triggered via the GitHub API + # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + defaults: + runs-on: ubuntu-latest + + steps: + - name: Checkout local repository + uses: actions/checkout@v3 + + # Run the action using default values as much as possible. + - name: Run action + uses: ./ # Use the action from the local path. + + expected-pass: + runs-on: ubuntu-latest + + env: + CHANGELOG_FILE_PATH: /tmp/CHANGELOG.md + steps: + - name: Checkout local repository + uses: actions/checkout@v3 + + - name: Run action + uses: ./ + with: + tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$' + case-insensitive-regex: true + changelog-file-path: "${{ env.CHANGELOG_FILE_PATH }}" + + - name: Verify report file exists + run: | + [ -e "${{ env.CHANGELOG_FILE_PATH }}" ] diff --git a/README.md b/README.md index 079c9d8..6b93bd2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Actions Status](https://github.com/arduino/create-changelog/workflows/Test%20Action/badge.svg)](https://github.com/arduino/create-changelog/actions) [![Check Packaging status](https://github.com/arduino/create-changelog/actions/workflows/check-packaging-ncc-typescript-npm.yml/badge.svg)](https://github.com/arduino/create-changelog/actions/workflows/check-packaging-ncc-typescript-npm.yml) +[![Integration Tests status](https://github.com/arduino/create-changelog/actions/workflows/test-integration.yml/badge.svg)](https://github.com/arduino/create-changelog/actions/workflows/test-integration.yml) This actions is an highly opinionated tool that creates changelogs from the git repository commit history.