|
87 | 87 |
|
88 | 88 | - name: Build |
89 | 89 | run: go build -v ./... |
| 90 | + |
| 91 | + integration-test: |
| 92 | + name: Integration Test |
| 93 | + runs-on: ubuntu-latest |
| 94 | + needs: [build] |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v4 |
| 97 | + |
| 98 | + - name: Set up Go |
| 99 | + uses: actions/setup-go@v5 |
| 100 | + with: |
| 101 | + go-version: '1.24' |
| 102 | + |
| 103 | + - name: Build binary |
| 104 | + run: go build -o raptor ./cmd/raptor |
| 105 | + |
| 106 | + - name: Test - No arguments (shows help) |
| 107 | + run: | |
| 108 | + OUTPUT=$(./raptor 2>&1) || true |
| 109 | + echo "$OUTPUT" |
| 110 | + echo "$OUTPUT" | grep -q "Usage: raptor" |
| 111 | +
|
| 112 | + - name: Test - help command |
| 113 | + run: | |
| 114 | + ./raptor help | grep -q "Usage: raptor" |
| 115 | +
|
| 116 | + - name: Test - -h flag |
| 117 | + run: | |
| 118 | + ./raptor -h | grep -q "Usage: raptor" |
| 119 | +
|
| 120 | + - name: Test - --help flag |
| 121 | + run: | |
| 122 | + ./raptor --help | grep -q "Usage: raptor" |
| 123 | +
|
| 124 | + - name: Test - version command |
| 125 | + run: | |
| 126 | + ./raptor version | grep -q "raptor" |
| 127 | +
|
| 128 | + - name: Test - -v flag |
| 129 | + run: | |
| 130 | + ./raptor -v | grep -q "raptor" |
| 131 | +
|
| 132 | + - name: Test - --version flag |
| 133 | + run: | |
| 134 | + ./raptor --version | grep -q "raptor" |
| 135 | +
|
| 136 | + - name: Test - unknown command (should fail) |
| 137 | + run: | |
| 138 | + if ./raptor unknown-command 2>&1; then |
| 139 | + echo "Expected failure but got success" |
| 140 | + exit 1 |
| 141 | + fi |
| 142 | + ./raptor unknown-command 2>&1 | grep -q "unknown command" |
| 143 | +
|
| 144 | + - name: Test - dry-run mode (without run command) |
| 145 | + run: | |
| 146 | + ./raptor -w testdata/workflows/simple.yml 2>&1 | grep -q -E "(dry-run|Dry-run|DRY)" |
| 147 | +
|
| 148 | + - name: Test - run with dry-run flag |
| 149 | + run: | |
| 150 | + ./raptor run -w testdata/workflows/simple.yml -n 2>&1 |
| 151 | +
|
| 152 | + - name: Test - run with --dry-run flag |
| 153 | + run: | |
| 154 | + ./raptor run -w testdata/workflows/simple.yml --dry-run 2>&1 |
| 155 | +
|
| 156 | + - name: Test - run specific job with dry-run |
| 157 | + run: | |
| 158 | + ./raptor run -w testdata/workflows/multi-job.yml -j build -n 2>&1 |
| 159 | +
|
| 160 | + - name: Test - missing workflow flag (should fail) |
| 161 | + run: | |
| 162 | + if ./raptor run 2>&1; then |
| 163 | + echo "Expected failure but got success" |
| 164 | + exit 1 |
| 165 | + fi |
| 166 | + ./raptor run 2>&1 | grep -q -E "(workflow|required)" |
0 commit comments