Change nbunksec to sec in nsyte command #40
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: CI Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: # Allows manual triggering | |
| permissions: | |
| contents: read # Needed to checkout the code | |
| jobs: | |
| test-action: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Test on common OSes. Add more if nsyte supports them and has releases. | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| # Use 'latest' to test the version resolution logic | |
| nsyte_version: ['latest'] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup dummy directory and secret | |
| shell: bash | |
| run: | | |
| mkdir test-dist | |
| echo "<html>Test index.html</html>" > test-dist/index.html | |
| echo "<html>Test fallback.html</html>" > test-dist/fallback.html | |
| echo "DUMMY_NBUNKSEC=nbunksec1fakebunkersecretstringforactiontestingpurposesonly" >> $GITHUB_ENV | |
| - name: Run nsite-action (Local Path) | |
| uses: ./ | |
| id: test_run | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| with: | |
| nbunksec: ${{ env.DUMMY_NBUNKSEC }} | |
| directory: './test-dist' | |
| nsyte_version: ${{ matrix.nsyte_version }} | |
| relays: | | |
| wss://nostr.example.com | |
| wss://relay.example.org | |
| servers: | | |
| wss://blossom.example.com | |
| force: true | |
| purge: false | |
| verbose: true | |
| fallback: '/fallback.html' | |
| concurrency: 2 | |
| continue-on-error: true # Expect failure with dummy nbunksec/relays/servers | |
| - name: Verify Action Attempted Run | |
| shell: bash | |
| run: | | |
| echo "Action outputs from test_run step:" | |
| echo " Status: ${{ steps.test_run.outputs.status }}" | |
| echo " nsyte Version Used: ${{ steps.test_run.outputs.nsyte_version_used }}" | |
| if [[ -z "${{ steps.test_run.outputs.nsyte_version_used }}" ]]; then | |
| echo "::error::Output 'nsyte_version_used' was NOT set." | |
| exit 1 | |
| else | |
| echo "Output 'nsyte_version_used' IS SET to: ${{ steps.test_run.outputs.nsyte_version_used }}" | |
| fi | |
| # Now that nsyte_version_used is confirmed, check status and version string | |
| if [[ "${{ steps.test_run.outputs.status }}" != "failure" ]]; then | |
| echo "::error::Expected status 'failure' due to dummy inputs, but got '${{ steps.test_run.outputs.status }}' or it was empty." | |
| exit 1 | |
| else | |
| echo "Status output correctly set to 'failure'." | |
| fi | |
| # Check if the version used is the expected latest (v0.5.3) when input is 'latest' | |
| if [[ "${{ inputs.nsyte_version }}" == "latest" && "${{ steps.test_run.outputs.nsyte_version_used }}" != "v0.5.3" ]]; then | |
| echo "::warning::Latest version detected was ${{ steps.test_run.outputs.nsyte_version_used }}, expected v0.5.3. Check nsyte release tagging or the action's version resolution logic." | |
| # Not failing the test for this warning, but it's important to note. | |
| fi | |
| echo "Verification passed: Outputs are populated, and status is 'failure' as expected with dummy inputs." |