🐛 Fixed a couple CLI bugs with capsule-sets #2436
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: rigdev/setup-go@main | |
with: | |
go-version-file: go.mod | |
save-cache: false | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
with: | |
version: 3.x | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache tools | |
uses: actions/cache@v3 | |
with: | |
path: | | |
tools/bin | |
key: ${{ runner.os }}-tools-${{ hashFiles('tools/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-tools- | |
- name: Generate code | |
run: task proto | |
- name: lint | |
run: task lint | |
test: | |
runs-on: ubuntu | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: rigdev/setup-go@main | |
with: | |
save-cache: false | |
go-version-file: go.mod | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
with: | |
version: 3.x | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache tools | |
uses: actions/cache@v3 | |
with: | |
path: | | |
tools/bin | |
key: ${{ runner.os }}-tools-${{ hashFiles('tools/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-tools- | |
- name: Build rig-operator | |
run: task build-rig-operator | |
- name: Run tests | |
run: task test-all | |
- name: Test Summary | |
uses: test-summary/action@v2 | |
with: | |
paths: "test-result.xml" | |
if: always() | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: cover.out | |
cli-import-test: | |
runs-on: ubuntu | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Set up Go | |
uses: rigdev/setup-go@main | |
with: | |
go-version: "1.22" | |
save-cache: false | |
- name: Test cli import | |
run: | | |
go mod init example.com | |
go mod edit -replace github.com/rigdev/rig=github.com/${{ github.event.pull_request.head.repo.owner.login }}/${{ github.event.pull_request.head.repo.name }}@${{ github.event.pull_request.head.sha }} | |
echo -e 'package main\nimport (\n _ "github.com/rigdev/rig/cmd/rig/cmd"\n)\nfunc main() {\n}\n' > main.go | |
go mod tidy | |
go run ./main.go | |
generated-files-committed: | |
runs-on: ubuntu | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: rigdev/setup-go@main | |
with: | |
go-version-file: go.mod | |
save-cache: false | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
with: | |
version: 3.x | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache tools | |
uses: actions/cache@v3 | |
with: | |
path: | | |
tools/bin | |
key: ${{ runner.os }}-tools-${{ hashFiles('tools/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-tools- | |
- name: Check for uncommitted changes after generating files | |
run: | | |
task gen | |
go mod tidy | |
cd tools && go mod tidy | |
GIT_STATUS="$(git status --porcelain)" | |
if [ -n "$GIT_STATUS" ]; then | |
echo "Repository has uncommited files:" | |
echo "$GIT_STATUS" | |
exit 1 | |
fi |