File tree Expand file tree Collapse file tree 4 files changed +71
-1
lines changed
Expand file tree Collapse file tree 4 files changed +71
-1
lines changed Original file line number Diff line number Diff line change 1+ export GITHUB_TOKEN="gh123abc"
Original file line number Diff line number Diff line change 3636 run : npm run test
3737 env :
3838 GITHUB_TOKEN : ${{ secrets.GH_TKN }}
39+
40+ # docs: https://github.com/marketplace/actions/build-and-push-docker-images
41+ - name : Set up QEMU
42+ uses : docker/setup-qemu-action@v3
43+
44+ - name : Set up Docker Buildx
45+ uses : docker/setup-buildx-action@v3
46+
47+ # docs: https://docs.docker.com/build/ci/github-actions/test-before-push/
48+ - name : Build Docker image
49+ uses : docker/build-push-action@v5
50+ with :
51+ push : false
52+ context : .
53+ load : true
54+ tags : github-graphql-client:latest
55+
56+ - name : Run Docker tests
57+ env :
58+ GITHUB_TOKEN : ${{ secrets.GH_TKN }}
59+ run : npm run docker:test
60+ continue-on-error : true
Original file line number Diff line number Diff line change 1212 "test" : " jest" ,
1313 "test:index" : " jest --testPathPattern=index.test.js" ,
1414 "test:github" : " jest --testPathPattern=github.test.js" ,
15- "docker:build" : " docker build -t github-graphql-client -f Dockerfile ."
15+ "docker:build" : " docker build -t github-graphql-client -f Dockerfile ." ,
16+ "docker:test" : " ./test.docker.sh" ,
17+ "docker:all" : " npm run docker:build && npm run docker:test"
1618 },
1719 "keywords" : [
1820 " git" ,
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ source .env.sh
4+
5+ echo " ************** help *****************"
6+
7+ # test handling of single parameter
8+ docker run --rm \
9+ -v ./dummy:/app/dummy \
10+ -w /app \
11+ -e GITHUB_TOKEN \
12+ -e DEBUG \
13+ github-graphql-client:latest " --help"
14+
15+ echo " ************ branch arg missing *******************"
16+
17+ # test handling of multiple parameters
18+ docker run --rm \
19+ -v ./dummy:/app/dummy \
20+ -w /app \
21+ -e GITHUB_TOKEN \
22+ -e DEBUG \
23+ github-graphql-client:latest commit -o pirafrank -r ' test-repo' -c dummy/file1.txt -m ' this is a commit msg'
24+
25+ echo " ************** all separated *****************"
26+
27+ # test handling of multiple parameters
28+ docker run --rm \
29+ -v ./dummy:/app/dummy \
30+ -w /app \
31+ -e GITHUB_TOKEN \
32+ -e DEBUG \
33+ github-graphql-client:latest commit -o pirafrank -r ' test-repo' -b main -c dummy/file1.txt -m onewordcommitmsg
34+
35+ echo " ************** all as one arg *****************"
36+
37+ # test multiple parameters surrounded by double quotes
38+ # this is to test if the entrypoint.sh script can handle double quotes,
39+ # because GitHub Actions will pass arguments as a single string.
40+ docker run --rm \
41+ -v ./dummy:/app/dummy \
42+ -w /app \
43+ -e GITHUB_TOKEN \
44+ -e DEBUG \
45+ github-graphql-client:latest " commit -o pirafrank -r " test-repo" -b main -c dummy/file1.txt -m 'this is a commit msg'"
You can’t perform that action at this time.
0 commit comments