diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b91944b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + name: Go 1.26 on ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: "1.26.x" + + - name: Lint + if: matrix.os == 'ubuntu-latest' + run: | + if [ -n "$(gofmt -l .)" ]; then + echo "Go code is not formatted. Run 'gofmt -w .'" + exit 1 + fi + go vet ./... + + - name: Install + run: go install ./cmd/modd + + - name: Test + run: | + go test -v -race ./... + go run ./cmd/modd --help