fixup! Fix Docker builds after upgrade to 1.23 (#153) (#154) #109
Workflow file for this run
This file contains 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 Tests - Solana" | |
on: push | |
jobs: | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.23 | |
if: success() | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.23 | |
- name: Checkout code | |
if: success() | |
uses: actions/checkout@v3 | |
- name: Download module dependencies | |
if: success() | |
env: | |
GOPROXY: "https://proxy.golang.org" | |
run: | | |
go clean -modcache | |
go mod download | |
- name: Copy config to /etc/metrikad | |
if: success() | |
run: | | |
sudo rm -rf /etc/metrikad; | |
sudo mkdir -vp /etc/metrikad; | |
sudo chown -R ${USER} /etc/metrikad | |
cp -r configs /etc/metrikad/ | |
- name: Install libsystemd-dev | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libsystemd-dev | |
- name: Run go test | |
if: success() | |
id: tests | |
run: make test-solana | |
- name: Slack Notification Failure | |
if: failure() | |
id: status | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_MESSAGE: "${{ github.event.head_commit.message }}" | |
SLACK_TITLE: GitHub CI Agent tests | |
SLACK_WEBHOOK: ${{ secrets.METRIKA_SLACK_NON_PROD_WEBHOOK }} | |
SLACK_ICON: https://app.metrika.co/logo192.png?size=48 | |
SLACK_CHANNEL: "cicd-node-agent" | |
SLACK_USERNAME: "github-ci-metrika-agent" | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_FOOTER: "Sent by GitHub CI from Metrika Agent repo" | |
agent_install_tests: | |
name: Agent Install Tests | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.23 | |
if: success() | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.23 | |
- name: Checkout code | |
if: success() | |
uses: actions/checkout@v3 | |
- name: "Get tag data" | |
if: success() | |
id: git_tags | |
run: | | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
git fetch --prune --unshallow | |
- name: Download module dependencies | |
if: success() | |
env: | |
GOPROXY: "https://proxy.golang.org" | |
run: | | |
go clean -modcache | |
go mod download | |
- name: Get latest release tag | |
if: success() | |
id: git_last_tag | |
run: | | |
echo '::set-output name=previous_tag::$(git tag --sort=version:refname | grep -E "v[0-9]+.[0-9]+.[0-9]+$" | tail -n1)' | |
- name: Run Agent Install Tests - Solana | |
if: success() | |
id: run_agent_install_tests_solana | |
env: | |
MA_PLATFORM: amd64 | |
MA_BLOCKCHAIN: solana | |
INSTALLER_STATUS: "" | |
run: | | |
if ! MA_BLOCKCHAIN=$MA_BLOCKCHAIN ./install.sh --prerelease >installer.log 2>&1; then | |
cat installer.log | |
echo "::set-output name=installer_status::Installer exited with error" | |
exit 1 | |
fi | |
# if ! grep -i 'Latest Release:' installer.log | grep -i "$(echo ${{ steps.git_last_tag.outputs.previous_tag }} | cut -d 'v' -f2)"; then | |
# # expected_ver=$(echo ${{ steps.git_last_tag.outputs.previous_tag }} | cut -d 'v' -f2) | |
# expected_ver="solana-pre" | |
# found_ver=$(grep -i 'Latest Release:' installer.log | cut -d ':' -f2) | |
# echo "::set-output name=installer_status::Installer tag is not latest tag $found_ver - Expected $expected_ver" | |
# exit 1 | |
# fi | |
cat /etc/passwd | grep -i metrikad | |
if ! grep -iq "metrikad" /etc/passwd; then | |
echo "::set-output name=installer_status::Metrikad user not found" | |
exit 1 | |
fi | |
if [[ ! -e /etc/metrikad/configs || ! -d /etc/metrikad/configs ]]; then | |
echo "::set-output name=installer_status::/etc/metrikad/configs does not exist or it is not a directory" | |
exit 1 | |
fi | |
if [[ ! -e /opt/metrikad || ! -d /opt/metrikad ]]; then | |
echo "::set-output name=installer_status::/opt/metrikad does not exist or it is not a directory" | |
exit 1 | |
fi | |
if ! systemctl list-unit-files | grep -iE "^metrikad-solana"; then | |
echo "::set-output name=installer_status::metrikad systemd unit does not exist" | |
exit 1 | |
fi | |
if ! systemctl is-active metrikad-solana.service >/dev/null; then | |
echo "::set-output name=installer_status::metrikad systemd unit is not running" | |
exit 1 | |
fi | |
if ! systemctl is-enabled metrikad-solana.service >/dev/null; then | |
echo "::set-output name=installer_status::metrikad systemd unit is not enabled" | |
exit 1 | |
fi | |
- name: Slack Notification Failure - Solana | |
if: failure() | |
id: status_failure_solana | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_MESSAGE: "${{ steps.run_agent_install_tests_solana.outputs.installer_status }}" | |
SLACK_TITLE: GitHub CI Agent Install Tests | |
SLACK_WEBHOOK: ${{ secrets.METRIKA_SLACK_NON_PROD_WEBHOOK }} | |
SLACK_ICON: https://app.metrika.co/logo192.png?size=48 | |
SLACK_CHANNEL: "cicd-node-agent" | |
SLACK_USERNAME: "github-ci-metrika-agent" | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_FOOTER: "Sent by GitHub CI from Metrika Agent repo" | |
reports: | |
needs: agent_install_tests | |
name: CI Report - Solana | |
runs-on: ubuntu-latest | |
steps: | |
- name: Slack Notification Success | |
if: success() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_MESSAGE: "${{ github.event.head_commit.message }}" | |
SLACK_TITLE: GitHub CI Agent | |
SLACK_WEBHOOK: ${{ secrets.METRIKA_SLACK_NON_PROD_WEBHOOK }} | |
SLACK_ICON: https://avatars.githubusercontent.com/u/72256945?s=400&u=69542ec14c7e72b8e1c203782d63e653d6853f0e&v=4&size=48 | |
SLACK_CHANNEL: "cicd-node-agent" | |
SLACK_USERNAME: "github-ci-metrika-agent" | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_FOOTER: "Sent by GitHub CI from Metrika Agent repo" | |