File tree Expand file tree Collapse file tree 5 files changed +135
-0
lines changed
Expand file tree Collapse file tree 5 files changed +135
-0
lines changed Original file line number Diff line number Diff line change 1+ /.dev
2+ /dist
3+ /lib
4+ /node_modules
Original file line number Diff line number Diff line change @@ -14,6 +14,19 @@ Contributions to this project are [released](https://help.github.com/articles/gi
14147 . Push to your fork and [ submit a pull request] ( https://github.com/docker/setup-qemu-action/compare )
15158 . Pat your self on the back and wait for your pull request to be reviewed and merged.
1616
17+ ## Container based developer flow
18+
19+ If you don't want to maintain a Node developer environment that fits this project you can use containerized commands
20+ instead of invoking yarn directly.
21+
22+ ```
23+ # format code and build javascript artifacts
24+ docker buildx bake pre-checkin
25+
26+ # validate all code has correctly formatted and built
27+ docker buildx bake validate
28+ ```
29+
1730Here are a few things you can do that will increase the likelihood of your pull request being accepted:
1831
1932- Make sure the ` README.md ` and any other relevant ** documentation are kept up-to-date** .
Original file line number Diff line number Diff line change 1+ name : validate
2+
3+ on :
4+ push :
5+ branches :
6+ - ' master'
7+ - ' releases/v*'
8+ paths-ignore :
9+ - ' **.md'
10+ pull_request :
11+ branches :
12+ - ' master'
13+ paths-ignore :
14+ - ' **.md'
15+
16+ jobs :
17+ validate :
18+ runs-on : ubuntu-latest
19+ steps :
20+ -
21+ name : Checkout
22+ uses : actions/checkout@v2
23+ -
24+ name : Validate
25+ run : docker buildx bake validate
Original file line number Diff line number Diff line change 1+ #syntax=docker/dockerfile:1.2
2+
3+ FROM node:12 AS deps
4+ WORKDIR /src
5+ COPY package.json yarn.lock ./
6+ RUN --mount=type=cache,target=/src/node_modules \
7+ yarn install
8+
9+ FROM scratch AS update-yarn
10+ COPY --from=deps /src/yarn.lock /
11+
12+ FROM deps AS validate-yarn
13+ COPY .git .git
14+ RUN status=$(git status --porcelain -- yarn.lock); if [ -n "$status" ]; then echo $status; exit 1; fi
15+
16+ FROM deps AS base
17+ COPY . .
18+
19+ FROM base AS build
20+ RUN --mount=type=cache,target=/src/node_modules \
21+ yarn build
22+
23+ FROM base AS run-format
24+ RUN --mount=type=cache,target=/src/node_modules \
25+ yarn run format
26+
27+ FROM scratch AS format
28+ COPY --from=run-format /src/src/*.ts /src/
29+
30+ FROM base AS validate-format
31+ RUN --mount=type=cache,target=/src/node_modules \
32+ yarn run format-check
33+
34+ FROM scratch AS dist
35+ COPY --from=build /src/dist/ /dist/
36+
37+ FROM build AS validate-build
38+ RUN status=$(git status --porcelain -- dist); if [ -n "$status" ]; then echo $status; exit 1; fi
39+
40+ FROM base AS dev
41+ ENTRYPOINT ["bash"]
Original file line number Diff line number Diff line change 1+ variable "GITHUB_REPOSITORY" {
2+ default = " docker/setup-qemu-action"
3+ }
4+
5+ group "default" {
6+ targets = [" build" ]
7+ }
8+
9+ group "pre-checkin" {
10+ targets = [" update-yarn" , " format" , " build" ]
11+ }
12+
13+ group "validate" {
14+ targets = [" validate-format" , " validate-build" , " validate-yarn" ]
15+ }
16+
17+ target "dockerfile" {
18+ dockerfile = " Dockerfile.dev"
19+ }
20+
21+ target "update-yarn" {
22+ inherits = [" dockerfile" ]
23+ target = " update-yarn"
24+ output = [" ." ]
25+ }
26+
27+ target "build" {
28+ inherits = [" dockerfile" ]
29+ target = " dist"
30+ output = [" ." ]
31+ }
32+
33+ target "format" {
34+ inherits = [" dockerfile" ]
35+ target = " format"
36+ output = [" ." ]
37+ }
38+
39+ target "validate-format" {
40+ inherits = [" dockerfile" ]
41+ target = " validate-format"
42+ }
43+
44+ target "validate-build" {
45+ inherits = [" dockerfile" ]
46+ target = " validate-build"
47+ }
48+
49+ target "validate-yarn" {
50+ inherits = [" dockerfile" ]
51+ target = " validate-yarn"
52+ }
You can’t perform that action at this time.
0 commit comments