Skip to content

Commit 5e5f495

Browse files
authored
feat: Add PR checks workflow (#3)
* feat: Add staticcheck linting * fix: Fix workflow syntax error * fix: Fix lint workflow * fix: Fix go version * yeah I don't know * fix: Update staticcheck * feat: Update README
1 parent 01a7558 commit 5e5f495

4 files changed

Lines changed: 74 additions & 6 deletions

File tree

.github/workflows/pr-checks.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- uses: extractions/setup-just@v1
14+
15+
- name: "Set up Go"
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.23.1'
19+
20+
- name: Build
21+
run: just build
22+
23+
lint:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- uses: extractions/setup-just@v1
30+
31+
- name: "Set up Go"
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: '1.23.1'
35+
36+
- name: Install staticcheck
37+
uses: dominikh/staticcheck-action@v1.2.0
38+
with:
39+
version: '2024.1.1'
40+
install-go: false
41+
min-go-version: '1.23.1'
42+
43+
- name: Run lint
44+
run: just lint
45+
46+
unit-test:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
52+
- uses: extractions/setup-just@v1
53+
54+
- name: "Set up Go"
55+
uses: actions/setup-go@v5
56+
with:
57+
go-version: '1.23.1'
58+
59+
- name: Unit tests
60+
run: go test ./...

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
- '*'
77
branches:
88
- main
9-
pull_request:
9+
10+
permissions:
11+
contents: write
1012

1113
jobs:
1214
build:
@@ -25,7 +27,7 @@ jobs:
2527
- name: "Set up Go"
2628
uses: actions/setup-go@v5
2729
with:
28-
go-version: '^1.13.1'
30+
go-version: '^1.23.1'
2931

3032
- name: Build binaries
3133
run: just build

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
[![Build and Release](https://github.com/simse/faster-graphql-codegen/actions/workflows/release.yml/badge.svg)](https://github.com/simse/faster-graphql-codegen/actions/workflows/release.yml)
12
# 🚀 faster-graphql-codegen 🚀
23
A reimplementation of graphql-codegen designed to be (much) faster than the original. It aims to be drop-in compatible where possible.
34

5+
[Docs](https://faster-graphql-codegen.simse.io/) | [Quick Start](https://faster-graphql-codegen.simse.io/quick-start)
6+
47
## Current functionality
58
- [x] Parse single graphql schema from file
69
- [ ] Parse and merge multiple graphql schemas
@@ -10,14 +13,14 @@ A reimplementation of graphql-codegen designed to be (much) faster than the orig
1013
- [x] Comments
1114
- [x] InputObjects
1215
- [x] Objects
13-
- [ ] Implements
14-
- [ ] Custom Scalars
16+
- [x] Implements
17+
- [x] Custom Scalars
1518
- [ ] Lots of other things
16-
- [ ] Load .yaml config
19+
- [x] Load .yaml config
1720
- [ ] Load .js/.ts config
1821
- [ ] Extract and generate types for queries
1922
- [ ] Extract and generate types for mutations
20-
- [ ] Monorepo support
23+
- [x] Monorepo support
2124

2225
## Yo!
2326
This is still just an experiment.

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ build:
3030
go build -ldflags="-s -w" -o "build/$output" .
3131
done
3232
done
33+
34+
lint:
35+
staticcheck ./...

0 commit comments

Comments
 (0)