Skip to content

Merge pull request #1366 from mackerelio/dependabot/github_actions/ac… #1442

Merge pull request #1366 from mackerelio/dependabot/github_actions/ac…

Merge pull request #1366 from mackerelio/dependabot/github_actions/ac… #1442

Workflow file for this run

---
name: test
on:
push:
branches:
- master
tags:
- v*
pull_request:
env:
DEBIAN_FRONTEND: noninteractive
jobs:
lint:
uses: mackerelio/workflows/.github/workflows/go-lint.yml@6cab415574bf67882182b34516fd2934b9dc5800 # v1.7.0
with:
os-versions: '["ubuntu-latest", "windows-2025"]'
test:
uses: mackerelio/workflows/.github/workflows/go-test.yml@6cab415574bf67882182b34516fd2934b9dc5800 # v1.7.0
with:
os-versions: '["ubuntu-latest", "windows-2025"]'
pre: |
echo "GOTOOLCHAIN=auto" >> $GITHUB_ENV
integration-test-linux:
uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@6cab415574bf67882182b34516fd2934b9dc5800 # v1.7.0
with:
os-versions: '["ubuntu-latest"]'
run: |
export GOTOOLCHAIN=auto
make testconvention
./test.bash
integration-test-windows:
uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@6cab415574bf67882182b34516fd2934b9dc5800 # v1.7.0
with:
os-versions: '["windows-2025"]'
run: |
export GOTOOLCHAIN=auto
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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.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 }}