chore(deps): update actions/setup-node action to v6 #221
This file contains hidden or 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: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| go-lint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | |
| with: | |
| version: latest | |
| go-test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run tests | |
| run: go test ./... -race -coverprofile=coverage.out | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: coverage | |
| path: coverage.out | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.out | |
| fail_ci_if_error: false | |
| verbose: true | |
| go-build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Build | |
| run: go build ./cmd/ccw | |
| shellcheck: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Run shellcheck | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y shellcheck | |
| shellcheck bin/ccw | |
| shfmt: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Install shfmt | |
| run: | | |
| go install mvdan.cc/sh/v3/cmd/shfmt@latest | |
| echo "$HOME/go/bin" >> "$GITHUB_PATH" | |
| - name: Check formatting | |
| run: shfmt -d -i 2 -ci bin/ccw | |
| bats: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install bats | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y bats | |
| - name: Configure git identity | |
| run: | | |
| git config --global user.email "ci@example.com" | |
| git config --global user.name "ci" | |
| - name: Run bats | |
| run: bats tests/ | |
| cspell: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Run cspell | |
| run: | | |
| npm exec -y --package=cspell -- cspell lint \ | |
| --no-progress --dot --config .cspell/cspell.json \ | |
| "**/*" | |
| workflow-result: | |
| needs: [go-lint, go-test, go-build, shellcheck, shfmt, bats, cspell] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check workflow result | |
| run: | | |
| if [ "${{ needs.go-lint.result }}" != "success" ]; then | |
| echo "go-lint failed: ${{ needs.go-lint.result }}" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.go-test.result }}" != "success" ]; then | |
| echo "go-test failed: ${{ needs.go-test.result }}" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.go-build.result }}" != "success" ]; then | |
| echo "go-build failed: ${{ needs.go-build.result }}" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.shellcheck.result }}" != "success" ]; then | |
| echo "shellcheck failed: ${{ needs.shellcheck.result }}" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.shfmt.result }}" != "success" ]; then | |
| echo "shfmt failed: ${{ needs.shfmt.result }}" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.bats.result }}" != "success" ]; then | |
| echo "bats failed: ${{ needs.bats.result }}" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.cspell.result }}" != "success" ]; then | |
| echo "cspell failed: ${{ needs.cspell.result }}" | |
| exit 1 | |
| fi | |
| echo "All jobs completed successfully" |