fix(GH-43): Gracefully fail with version #83
Workflow file for this run
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
name: 'Preview' | |
on: | |
pull_request: | |
concurrency: | |
cancel-in-progress: false | |
group: preview-${{ github.ref_name }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
outputs: | |
sem-ver: ${{ steps.get-version.outputs.semVer }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v1.1.1 | |
with: | |
versionSpec: '6.x' | |
- name: Get version | |
id: get-version | |
uses: gittools/actions/gitversion/execute@v1.1.1 | |
with: | |
targetPath: ./ | |
disableCache: true | |
useConfigFile: true | |
configFilePath: GitVersion.yml | |
env: | |
BUILD_NUMBER: ${{ github.run_number }} | |
- name: Restore dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm run test | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
./test-results/junit.xml | |
- name: Package | |
run: npm run package | |
- name: Verify changed files | |
uses: tj-actions/verify-changed-files@v20 | |
id: verify-changed-files | |
with: | |
fail-if-changed: true | |
fail-message: Files in the dist folder are not up-to-date. Please run 'npm run package' locally and commit the changes. | |
files: | | |
dist | |
test-action: | |
name: Test Action | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Restore | |
run: dotnet restore --no-cache ./sample/WebApplication/WebApplication.sln | |
- name: Test Action | |
id: test-action | |
uses: ./ | |
with: | |
add-pr-comment: true | |
add-check-run: true | |
target: ./sample/WebApplication/WebApplication.sln | |
fail-check-run-if-contains-outdated: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |