Fix actions-gen-readme, with tests now #399
Workflow file for this run
This file contains hidden or 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: 'Test' | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'release/**/*' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - 'release/**/*' | |
| workflow_dispatch: | |
| concurrency: | |
| group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}' | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: 'bash' | |
| permissions: | |
| contents: 'read' | |
| statuses: 'write' | |
| jobs: | |
| unit: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - 'ubuntu-latest' | |
| - 'windows-latest' | |
| - 'macos-latest' | |
| runs-on: '${{ matrix.os }}' | |
| steps: | |
| - uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4 | |
| - uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4 | |
| with: | |
| node-version-file: 'package.json' | |
| - name: 'npm build' | |
| run: 'npm ci && npm run build' | |
| - name: 'npm test' | |
| run: 'npm run test' | |
| actions-gen-readme: | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4 | |
| - uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4 | |
| with: | |
| node-version-file: 'package.json' | |
| - name: 'npm build' | |
| run: 'npm ci && npm run build' | |
| - name: 'Install command globally' | |
| run: |- | |
| npm install -g . | |
| - name: 'Copy fixtures and generate README' | |
| run: |- | |
| cp -R "./tests/fixtures/actions-gen-readme" "${RUNNER_TEMP}/actions-gen-readme" | |
| (cd "${RUNNER_TEMP}/actions-gen-readme" && actions-gen-readme) | |
| - name: 'Verify output' | |
| run: |- | |
| grep "Does things." "${RUNNER_TEMP}/actions-gen-readme/README.md" | |
| grep "Does other things." "${RUNNER_TEMP}/actions-gen-readme/README.md" | |
| grep "Has things." "${RUNNER_TEMP}/actions-gen-readme/README.md" | |
| cat "${RUNNER_TEMP}/actions-gen-readme/README.md" |