name: Tests on: pull_request: branches: [ develop, 'feature/**' ] push: branches: [ develop, 'feature/**' ] jobs: test: strategy: matrix: go-version: [stable] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} cache: false - uses: actions/checkout@v5 - name: Set up Go environment uses: actions/cache@v4 with: path: | ~/.cache/go-build ~/go key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Test Go linting (gofmt) if: startsWith(matrix.os, 'ubuntu') == true # https://olegk.dev/github-actions-and-go run: gofmt -s -w . && git diff --exit-code - name: Run Go tests run: go test -p 1 ./internal/storage ./server ./internal/smtpd ./internal/pop3 ./internal/tools ./internal/html2text ./internal/htmlcheck ./internal/linkcheck -v - name: Run Go benchmarking run: go test -p 1 ./internal/storage ./internal/html2text -bench=. # build the assets - name: Set up node environment if: startsWith(matrix.os, 'ubuntu') == true uses: actions/setup-node@v5 with: node-version: 22 cache: 'npm' - name: Install JavaScript dependencies if: startsWith(matrix.os, 'ubuntu') == true run: npm install - name: Run JavaScript linting if: startsWith(matrix.os, 'ubuntu') == true run: npm run lint - name: Test JavaScript packaging if: startsWith(matrix.os, 'ubuntu') == true run: npm run package # validate the swagger file - name: Validate OpenAPI definition if: startsWith(matrix.os, 'ubuntu') == true uses: swaggerexpert/swagger-editor-validate@v1 with: definition-file: server/ui/api/v1/swagger.json