Skip to content

Commit 59bb8f2

Browse files
authored
Add Makefile, tweak actions (#135)
- Add Makefile with dev tasks - Clean up action files, remove unnecessary names - Rename `deno` workflow to `ci`
1 parent 65c2402 commit 59bb8f2

File tree

5 files changed

+28
-19
lines changed

5 files changed

+28
-19
lines changed

.github/workflows/deno.yml .github/workflows/ci.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: Deno
2-
31
on:
42
push:
53
branches: ["main"]
@@ -12,14 +10,11 @@ permissions:
1210
jobs:
1311
test:
1412
runs-on: ubuntu-latest
15-
1613
steps:
1714
- uses: actions/checkout@v4
1815
- uses: denoland/setup-deno@v1
19-
- run: deno fmt --check
20-
- run: deno lint
21-
- run: shopt -s globstar; deno check src/**/*.ts
22-
- run: deno test -A
16+
- run: make lint
17+
- run: make test
2318
env:
2419
BACKPORTER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2520
BACKPORTER_GITEA_FORK: GiteaBot/gitea

.github/workflows/deploy-to-fly.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: Deploy to Fly
21
on:
32
push:
43
branches: ["main"]
4+
55
jobs:
66
deploy:
7-
name: Deploy proxy
87
runs-on: ubuntu-latest
98
steps:
109
- uses: actions/checkout@v4

.github/workflows/docker.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: Build Docker image
2-
31
on: ["pull_request"]
42

53
env:
@@ -12,17 +10,14 @@ jobs:
1210
contents: read
1311
packages: write
1412
steps:
15-
- name: Set up Docker Buildx
16-
uses: docker/setup-buildx-action@v2
17-
- name: Log in to the Container registry
18-
uses: docker/login-action@v2
13+
- uses: docker/setup-buildx-action@v2
14+
- uses: docker/login-action@v2
1915
with:
2016
registry: ${{ env.DOCKER_REGISTRY }}
2117
username: ${{ github.actor }}
2218
password: ${{ secrets.GITHUB_TOKEN }}
23-
- name: Extract metadata for Docker
19+
- uses: docker/metadata-action@v4
2420
id: meta
25-
uses: docker/metadata-action@v4
2621
with:
2722
images: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}
2823
tags: |
@@ -35,8 +30,7 @@ jobs:
3530
type=ref,event=pr
3631
# set latest tag for default branch
3732
type=raw,value=latest,enable={{is_default_branch}}
38-
- name: Build and push
39-
uses: docker/build-push-action@v4
33+
- uses: docker/build-push-action@v4
4034
with:
4135
push: false
4236
tags: ${{ steps.meta.outputs.tags }}

Makefile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
SRC_FILES := $(shell find src -type f -name '*.ts')
2+
3+
@PHONY: lint
4+
lint:
5+
@deno lint --quiet
6+
@deno fmt --quiet --check
7+
@deno check --quiet $(SRC_FILES)
8+
9+
@PHONY: fmt
10+
fmt:
11+
@deno fmt --quiet
12+
13+
@PHONY: test
14+
test:
15+
@deno test --quiet -A

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ deno run --allow-net --allow-env --allow-run --allow-sys src/webhook.ts
9696
This will spin up a web server on port 8000. You can then set up a GitHub
9797
webhook on `/trigger` to run this bot.
9898

99+
## Development
100+
101+
- `make fmt` runs the formatter
102+
- `make lint` runs the linter and checks formatting and types
103+
- `make test` runs the tests
104+
99105
## Contributing
100106

101107
Contributions are welcome!

0 commit comments

Comments
 (0)