Skip to content

Commit b0eccfe

Browse files
committed
Move submission parser tool to dedicated repository
1 parent cb6c0a2 commit b0eccfe

File tree

8 files changed

+10
-751
lines changed

8 files changed

+10
-751
lines changed

.github/workflows/check-go.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/manage-prs.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Manage PRs
22

3+
env:
4+
SUBMISSION_PARSER_VERSION: 1.0.0-rc2 # See: https://github.com/arduino/library-manager-submission-parser/releases
5+
36
on:
47
# pull_request_target trigger is used instead of pull_request so the token will have the write permissions needed to comment and merge.
58
# Note that this means the version of the workflow from the PR base ref will be used as opposed to the head ref, as is the case with pull_request triggered workflows.
@@ -25,7 +28,6 @@ jobs:
2528
contains(github.event.comment.body, 'ArduinoBot')
2629
)
2730
runs-on: ubuntu-latest
28-
2931
steps:
3032
- name: Dummy step to make job valid
3133
run: ""
@@ -77,27 +79,15 @@ jobs:
7779
index-entry: ${{ steps.parse-request.outputs.index-entry }}
7880

7981
steps:
80-
- name: Set environment variables
81-
run: |
82-
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
83-
echo "MANAGER_PATH=${{ runner.temp }}/manager" >> "$GITHUB_ENV"
84-
8582
- name: Checkout local repository
8683
uses: actions/checkout@v2
8784

88-
- name: Install Go
89-
uses: actions/setup-go@v2
90-
91-
- name: Install Taskfile
92-
uses: arduino/actions/setup-taskfile@master
85+
- name: Download submission parser
86+
id: download-parser
87+
uses: carlosperate/download-file-action@v1.0.3
9388
with:
94-
repo-token: ${{ secrets.GITHUB_TOKEN }}
95-
version: 3.x
96-
97-
- name: Build manager
98-
env:
99-
GO_BUILD_FLAGS: -o $MANAGER_PATH
100-
run: task go:build
89+
file-url: https://github.com/arduino/library-registry-submission-parser/releases/download/${{ env.SUBMISSION_PARSER_VERSION }}/parser
90+
location: ${{ runner.temp }}
10191

10292
- name: Download diff
10393
uses: actions/download-artifact@v2
@@ -108,7 +98,8 @@ jobs:
10898
- name: Parse request
10999
id: parse-request
110100
run: |
111-
REQUEST="$("$MANAGER_PATH" --diffpath="${{ needs.diff.outputs.path }}/${{ needs.diff.outputs.filename }}" --repopath="${{ github.workspace }}" --listname="repositories.txt")"
101+
chmod u+x "${{ steps.download-parser.outputs.file-path }}"
102+
REQUEST="$("${{ steps.download-parser.outputs.file-path }}" --diffpath="${{ needs.diff.outputs.path }}/${{ needs.diff.outputs.filename }}" --repopath="${{ github.workspace }}" --listname="repositories.txt")"
112103
# Due to limitations of the GitHub Actions workflow system, dedicated outputs must be created for use in certain workflow fields.
113104
echo "::set-output name=type::$(echo "$REQUEST" | jq -r -c '.type')"
114105
echo "::set-output name=submissions::$(echo "$REQUEST" | jq -c '.submissions')"

.gitignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

Taskfile.yml

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,9 @@
11
version: "3"
22

33
vars:
4-
DEFAULT_GO_PACKAGES:
5-
sh: echo `cd manager && go list ./... | tr '\n' ' '`
6-
DEFAULT_GO_PATHS:
7-
sh: echo '`cd manager && go list -f '{{"{{"}}.Dir{{"}}"}}' ./...`'
8-
94
PRETTIER: prettier@2.1.2
105

116
tasks:
12-
go:build:
13-
desc: Build the project
14-
dir: manager
15-
cmds:
16-
- go build -v {{.GO_BUILD_FLAGS}}
17-
18-
check:
19-
desc: Test, lint, and check formatting of everything
20-
deps:
21-
- task: go:check
22-
- task: docs:check
23-
- task: config:check
24-
25-
go:check:
26-
desc: Test, lint, and check formatting of Go code
27-
deps:
28-
- task: go:lint
29-
- task: go:test
30-
- task: go:check-formatting
31-
32-
go:lint:
33-
desc: Lint Go code
34-
dir: manager
35-
cmds:
36-
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
37-
- go get golang.org/x/lint/golint
38-
- |
39-
GOLINT_PATH="$(go list -f '{{"{{"}}.Target{{"}}"}}' golang.org/x/lint/golint || echo "false")"
40-
"$GOLINT_PATH" {{default "-min_confidence 0.8 -set_exit_status" .GO_LINT_FLAGS}} "{{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}"
41-
42-
go:test:
43-
desc: Run unit tests
44-
dir: manager
45-
cmds:
46-
- go test -v -short -run '{{default ".*" .GO_TEST_REGEX}}' {{default "-timeout 10m -coverpkg=./... -covermode=atomic" .GO_TEST_FLAGS}} -coverprofile=coverage_unit.txt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
47-
48-
go:check-formatting:
49-
desc: Check Go code formatting
50-
dir: manager
51-
cmds:
52-
- |
53-
RESULTS="$(gofmt -l {{default .DEFAULT_GO_PATHS .GO_PATHS}})"
54-
echo "$RESULTS"
55-
test -z "$RESULTS"
56-
577
docs:check:
588
desc: Lint and check formatting of documentation files
599
deps:
@@ -119,18 +69,6 @@ tasks:
11969
cmds:
12070
- npx {{.PRETTIER}} --check "**/*.{yml,yaml,json}"
12171

122-
format:
123-
desc: Format all files
124-
deps:
125-
- task: go:format
126-
- task: docs:format
127-
- task: config:format
128-
129-
go:format:
130-
desc: Format Go code
131-
cmds:
132-
- gofmt -l -w {{default .DEFAULT_GO_PATHS .GO_PATHS}}
133-
13472
docs:format:
13573
desc: Format documentation files
13674
cmds:

manager/go.mod

Lines changed: 0 additions & 10 deletions
This file was deleted.

manager/go.sum

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)