update CI #1414
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: test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - v* | |
| pull_request: | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| jobs: | |
| lint: | |
| uses: mackerelio/workflows/.github/workflows/go-lint.yml@7653987676cc233af59a390d142b5cf6e65a526f # v1.6.0 | |
| with: | |
| os-versions: '["ubuntu-latest", "windows-2025"]' | |
| test: | |
| uses: mackerelio/workflows/.github/workflows/go-test.yml@7653987676cc233af59a390d142b5cf6e65a526f # v1.6.0 | |
| with: | |
| os-versions: '["ubuntu-latest", "windows-2025"]' | |
| integration-test-linux: | |
| uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@7653987676cc233af59a390d142b5cf6e65a526f # v1.6.0 | |
| with: | |
| os-versions: '["ubuntu-latest"]' | |
| run: | | |
| make testconvention | |
| ./test.bash | |
| integration-test-windows: | |
| uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@7653987676cc233af59a390d142b5cf6e65a526f # v1.6.0 | |
| with: | |
| os-versions: '["windows-2025"]' | |
| run: | | |
| go build -o mackerel-plugin-mssql/mackerel-plugin-mssql.exe ./mackerel-plugin-mssql | |
| go build -o mackerel-plugin-windows-server-sessions/mackerel-plugin-windows-server-sessions.exe ./mackerel-plugin-windows-server-sessions | |
| build: | |
| needs: [test, integration-test-linux] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - run: | | |
| sudo apt-get update | |
| sudo apt-get install -y rpm devscripts debhelper fakeroot crossbuild-essential-arm64 build-essential | |
| mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version: 1.24.x | |
| - run: make clean rpm deb tar | |
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: linux-build-artifacts | |
| path: | | |
| ~/rpmbuild/RPMS/*/*.rpm | |
| packaging/*.deb | |
| packaging/tar/build/*.tar.gz | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: linux-build-artifacts | |
| path: artifacts/ | |
| - uses: mackerelio/staging-release-update-action@bc0e3a9f7bd0d890dc044592a798bc307bacc956 # v0.0.1 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| directory: artifacts/ | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: staging | |
| - uses: mackerelio/create-release-action@5af34070474b72efdb3f5057e50d2f3836453c56 # v0.0.4 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| directory: artifacts/ | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| tag-prefix: "refs/tags/v" | |
| bump-up-branch-prefix: "bump-version-" | |
| - uses: 8398a7/action-slack@77eaa4f1c608a7d68b38af4e3f739dcd8cba273e # v3.19.0 | |
| with: | |
| status: ${{ job.status }} | |
| fields: repo,message,commit,action,eventName,ref,workflow,job,took | |
| username: mackerel-agent-plugins-release | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.MACKEREL_SLACK_WEBHOOK_URL }} |