8000 Add Makefile, tweak actions by silverwind · Pull Request #135 · GiteaBot/gitea-backporter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Makefile, tweak actions #135

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
merged 8 commits into 8000 from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/deno.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Deno

on:
push:
branches: ["main"]
Expand All @@ -12,14 +10,11 @@ permissions:
jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
- run: deno fmt --check
- run: deno lint
- run: shopt -s globstar; deno check src/**/*.ts
- run: deno test -A
- run: make lint
- run: make test
env:
BACKPORTER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BACKPORTER_GITEA_FORK: GiteaBot/gitea
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy-to-fly.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Deploy to Fly
on:
push:
branches: ["main"]

jobs:
deploy:
name: Deploy proxy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Build Docker image

on: ["pull_request"]

env:
Expand All @@ -12,17 +10,14 @@ jobs:
contents: read
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
- uses: docker/metadata-action@v4
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}
tags: |
Expand All @@ -35,8 +30,7 @@ jobs:
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v4
- uses: docker/build-push-action@v4
with:
push: false
tags: ${{ steps.meta.outputs.tags }}
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SRC_FILES := $(shell find src -type f -name '*.ts')

@PHONY: lint
lint:
@deno lint --quiet
@deno fmt --quiet --check
@deno check --quiet $(SRC_FILES)

@PHONY: fmt
fmt:
@deno fmt --quiet

@PHONY: test
test:
@deno test --quiet -A
6 changes: 6 additions & 0 deletions README.md
7CA2
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ deno run --allow-net --allow-env --allow-run --allow-sys src/webhook.ts
This will spin up a web server on port 8000. You can then set up a GitHub
webhook on `/trigger` to run this bot.

## Development

- `make fmt` runs the formatter
- `make lint` runs the linter and checks formatting and types
- `make test` runs the tests

## Contributing

Contributions are welcome!
Expand Down
Loading
0