feat: comment on pull requests with the next version of the software, if it deploys #304
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Run Deno tests | |
run: deno test --allow-env --allow-run --allow-read --allow-write --junit-path reports/junit.xml --coverage=reports/coverage/ | |
- name: Generate coverage report | |
run: deno coverage --lcov --output=reports/coverage.lcov reports/coverage/ | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: junit-results | |
path: reports/junit.xml | |
- name: Upload coverage for analysis | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: reports/coverage.lcov | |
env: | |
# try and speedup the action by homebrew not having to do more then it needs when installing the coveralls tool | |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: true | |
- name: Annotate failed tests | |
if: always() # Run with test/lint failures. | |
uses: granodigital/report-annotate@v1.0.1 | |
with: | |
reports: | | |
junit|reports/junit.xml | |
test-it-runs: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' # Only run on PRs, otherwise we will trigger a deployment by accident. | |
permissions: | |
contents: read # only offer read permissions for dry-run to prevent accidental deployments | |
pull-requests: write # allow commenting on PRs | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run deployment tool in dry-run mode | |
uses: ./ | |
with: | |
version: ${{ github.sha }} | |
github_token: ${{ secrets.github_token }} | |
# Test that the config is read by the tool and pre-release versions are working. | |
analyze_commits_config: | | |
{ | |
"branches": [ | |
{ "branch_name": "${{ github.ref_name }}", "prerelease": true, "version_suffix": "test" } | |
] | |
} |