hishtory/.github/workflows/go-test.yml

75 lines
2.2 KiB
YAML
Raw Normal View History

name: Go Tests
2022-04-09 20:56:25 +02:00
on:
workflow_dispatch:
2022-09-17 20:54:26 +02:00
pull_request:
schedule:
- cron: '0 0 * * *'
2022-04-09 20:56:25 +02:00
push:
2022-04-09 20:58:49 +02:00
branches: [ master ]
2022-04-09 20:56:25 +02:00
jobs:
test:
2022-04-17 19:50:37 +02:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
2022-11-10 00:12:15 +01:00
os: [ubuntu-latest, macos-latest]
fail-fast: false
2022-04-09 20:56:25 +02:00
steps:
- uses: actions/checkout@v4
2022-04-09 20:56:25 +02:00
- name: Set up Go
uses: actions/setup-go@v3
2022-04-09 20:56:25 +02:00
with:
go-version: 1.21
- name: Linux Setup
2023-10-11 07:20:07 +02:00
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
# Install our dependencies
sudo apt-get update
sudo apt-get install -y zsh tmux fish
# Work around a weird bug where zsh on ubuntu actions gives that directory 0777 which makes zsh refuse to start
sudo chmod 0755 -R /usr/share/zsh/
# Set a consistent hostname so we can run tests that depend on it
sudo hostname ghaction-runner-hostname
- name: MacOS Setup
2023-10-11 07:20:07 +02:00
if: ${{ matrix.os == 'macos-latest'}}
run: |
# Install our dependencies
brew install fish tmux bash
# Set a consistent hostname so we can run tests that depend on it
sudo scutil --set HostName ghaction-runner-hostname
- name: MacOS Docker Setup
2023-10-11 07:20:07 +02:00
if: ${{ matrix.os == 'macos-latest'}}
continue-on-error: true
run: |
# Install docker so it can be used for datadog
brew install docker
colima start
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Set up Datadog
2023-10-11 07:20:07 +02:00
if: ${{ github.ref == 'refs/heads/master' }}
uses: datadog/agent-github-action@v1.3
with:
api_key: ${{ secrets.DD_API_KEY }}
2023-10-11 07:20:07 +02:00
- name: Extra Delay
if: ${{ startsWith(github.event.head_commit.message, 'Release') }}
run: |
# If this is a release, then sleep for before starting the tests so that the newest version is released
# and pushed to the updated server before we run the tests
sleep 1200 # 20 minutes
- name: Go test
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
run: |
make retrying-test
2023-09-03 03:25:09 +02:00
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true