-
-
Notifications
You must be signed in to change notification settings - Fork 42
Feat: setup testing infrastructure #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dahlia
merged 6 commits into
fedify-dev:main
from
ThisIsMissEm:feat/bootstrap-for-testing
Feb 22, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
42bf491
Migrate to bin/server.ts entrypoint to enable testing of the app
ThisIsMissEm a4626ae
Setup basic tests using tsx --test
ThisIsMissEm 53bd380
Ignore .env.test file
ThisIsMissEm cffaae5
Add test workflow
ThisIsMissEm 4de5638
Rename build workflow to release, and only run on pushes
ThisIsMissEm 197765b
Remove redis from CI configuration
ThisIsMissEm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| name: release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - stable | ||
| - "*.*-maintenance" | ||
| tags: | ||
| - "*.*.*" | ||
|
|
||
| jobs: | ||
| check: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dahlia I'm not sure we even need |
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9.15.1+sha512.1acb565e6193efbebda772702950469150cf12bcc764262e7587e71d19dc98a423dff9536e57ea44c49bdf790ff694e83c27be5faa23d67e0c033b583be4bfcf | ||
| run_install: false | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 23 | ||
| cache: pnpm | ||
| - run: pnpm install | ||
| - run: pnpm run check:ci | ||
| - if: github.ref_type == 'tag' | ||
| run: | | ||
| set -ex | ||
| [[ "$(jq -r .version package.json)" = "$GITHUB_REF_NAME" ]] | ||
| ! grep -i "to be released" CHANGES.md | ||
|
|
||
| build-image: | ||
| if: github.event_name == 'push' | ||
| needs: [check] | ||
ThisIsMissEm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| attestations: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-qemu-action@v3 | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ github.token }} | ||
| - uses: sergeysova/jq-action@v2 | ||
| id: version | ||
| with: | ||
| cmd: "jq -r .version package.json" | ||
| - if: github.ref_type == 'tag' | ||
| run: '[[ "$VERSION" = "$GITHUB_REF_NAME" ]]' | ||
| env: | ||
| VERSION: ${{ steps.version.outputs.value }} | ||
| - if: github.ref_type != 'tag' | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| push: true | ||
| platforms: linux/amd64, linux/arm64 | ||
| build-args: VERSION=${{ steps.version.outputs.value }}-dev.${{ github.run_number }} | ||
| tags: | | ||
| ghcr.io/${{ github.repository }}:git-${{ github.sha }} | ||
| ghcr.io/${{ github.repository }}:${{ steps.version.outputs.value }}-dev.${{ github.run_number }} | ||
| ghcr.io/${{ github.repository }}:canary | ||
| labels: org.opencontainers.image.revision=${{ github.sha }} | ||
| annotations: | | ||
| org.opencontainers.image.title=Hollo | ||
| org.opencontainers.image.description=Federated single-user microblogging software | ||
| org.opencontainers.image.url=https://docs.hollo.social/ | ||
| org.opencontainers.image.source=https://github.com/fedify-dev/hollo | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
| org.opencontainers.image.licenses=AGPL-3.0-only | ||
| org.opencontainers.image.version=${{ steps.version.outputs.value }}-dev.${{ github.run_number }} | ||
| cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:build-cache | ||
| cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:build-cache,mode=max | ||
| - if: github.ref_type == 'tag' | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| push: true | ||
| platforms: linux/amd64, linux/arm64 | ||
| build-args: VERSION=${{ steps.version.outputs.value }} | ||
| tags: | | ||
| ghcr.io/${{ github.repository }}:git-${{ github.sha }} | ||
| ghcr.io/${{ github.repository }}:${{ steps.version.outputs.value }} | ||
| ghcr.io/${{ github.repository }}:canary | ||
| ghcr.io/${{ github.repository }}:latest | ||
| labels: org.opencontainers.image.revision=${{ github.sha }} | ||
| annotations: | | ||
| org.opencontainers.image.title=Hollo | ||
| org.opencontainers.image.description=Federated single-user microblogging software | ||
| org.opencontainers.image.url=https://docs.hollo.social/ | ||
| org.opencontainers.image.source=https://github.com/fedify-dev/hollo | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
| org.opencontainers.image.licenses=AGPL-3.0-only | ||
| org.opencontainers.image.version=${{ steps.version.outputs.value }} | ||
| cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:build-cache | ||
| cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:build-cache,mode=max | ||
|
|
||
| release: | ||
| if: github.event_name == 'push' | ||
| needs: [check] | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - id: extract-changelog | ||
| uses: dahlia/submark@5a5ff0a58382fb812616a5801402f5aef00f90ce | ||
| with: | ||
| input-file: CHANGES.md | ||
| heading-level: 2 | ||
| heading-title-text: version ${{ github.ref_name }} | ||
| ignore-case: true | ||
| omit-heading: true | ||
| - run: 'cat "$CHANGES_FILE"' | ||
| env: | ||
| CHANGES_FILE: ${{ steps.extract-changelog.outputs.output-file }} | ||
| - if: github.event_name == 'push' && github.ref_type == 'tag' | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| body_path: ${{ steps.extract-changelog.outputs.output-file }} | ||
| name: Hollo ${{ github.ref_name }} | ||
| generate_release_notes: false | ||
|
|
||
| publish-docs: | ||
| if: | | ||
| github.event_name == 'push' && | ||
| (github.ref == 'refs/heads/main' || github.ref_type == 'tag') | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| pages: write | ||
| deployments: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| - run: | | ||
| bun install | ||
| bun run build | ||
| env: | ||
| PLAUSIBLE_DOMAIN: ${{ vars.PLAUSIBLE_DOMAIN }} | ||
| working-directory: ${{ github.workspace }}/docs/ | ||
| - uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: docs/dist | ||
| - if: github.ref_type == 'branch' | ||
| uses: nwtgck/[email protected] | ||
| with: | ||
| publish-dir: docs/dist | ||
| production-branch: main | ||
| github-token: ${{ github.token }} | ||
| enable-pull-request-comment: false | ||
| enable-commit-comment: false | ||
| env: | ||
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
| timeout-minutes: 2 | ||
| - if: github.ref_type == 'tag' | ||
| uses: actions/deploy-pages@v4 | ||
| # cSpell: ignore buildx sergeysova | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow is identical to the build.yaml workflow that's been removed, the only change is that we're not running this on pull requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably delete the conditionals here on if it's a push.