Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Repo to Github Actions #132

Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 0 additions & 91 deletions .circleci/config.yml

This file was deleted.

64 changes: 61 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
# Run test file with command:
# act pull_request -e testdata/act/pull-request.json

name: Test find flags
name: Test and Generate Docs

on: pull_request

jobs:
find-feature-flags:
Run_Go_Tests:
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Python
uses: actions/setup-python@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the sha instead of the version number

with:
python-version: '3.x'

- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: Run pre-commit hooks
run: pre-commit run --all-files

- name: Set up Go
uses: actions/setup-go@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the sha instead of the version number

with:
go-version: 1.22
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved

- name: Install dependencies
run: go mod tidy

- name: Run tests
run: go test ./... -coverprofile=coverage.out
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved

Run_E2E_Tests:
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
name: Test Find Flags
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -50,3 +80,31 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}

Generate_Docs:
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Python
uses: actions/setup-python@v4
kevinkruger marked this conversation as resolved.
Show resolved Hide resolved
with:
python-version: '3.x'

- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: Set up Node.js
uses: actions/setup-node@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the sha instead of the version number

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to use the sha here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the sha

with:
node-version: '18.8.0'

- name: Install action-docs
run: npm install action-docs

- name: Run pre-commit for GitHub Actions Docs
run: pre-commit run -a github-action-docs

hoshsadiq marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.52.2
rev: v1.62.2
hooks:
- id: golangci-lint
name: golangci-lint
Expand Down
5 changes: 4 additions & 1 deletion diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ func ProcessDiffs(matcher lsearch.Matcher, contents []byte, builder *refs.Refere
for _, flagKey := range elementMatcher.FindMatches(line) {
aliasMatches := elementMatcher.FindAliases(line, flagKey)
gha.Debug("Found (%s) reference to flag %s with aliases %v", op, flagKey, aliasMatches)
builder.AddReference(flagKey, op, aliasMatches)
err := builder.AddReference(flagKey, op, aliasMatches)
if err != nil {
fmt.Println(err)
}
}
if builder.MaxReferences() {
break
Expand Down
2 changes: 1 addition & 1 deletion internal/github_actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func MaskInput(input string) {
}

func Log(format string, a ...any) {
log.Println(fmt.Sprintf(format, a...))
fmt.Printf(format, a...)
}

func LogError(err error) {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func setOutputsForChangedFlags(modifier string, changedFlags []string) {
func failExit(err error) {
if err != nil {
gha.LogError(err)
gha.SetError(err.Error())
gha.SetError("%s", err.Error())
os.Exit(1)
}
}
Loading