mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-23 08:45:16 +01:00
68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
name: Go Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18
|
|
- name: Linux Setup
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release') && 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
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release') && 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
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release') && matrix.os == 'macos-latest'}}
|
|
continue-on-error: true
|
|
# 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
|
|
if: github.ref == 'refs/heads/master'
|
|
uses: datadog/agent-github-action@v1.3
|
|
with:
|
|
api_key: ${{ secrets.DD_API_KEY }}
|
|
- name: Go test
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release') }}
|
|
env:
|
|
DD_API_KEY: ${{ secrets.DD_API_KEY }}
|
|
run: |
|
|
make retrying-test
|
|
# - name: Setup tmate session
|
|
# if: ${{ failure() }}
|
|
# uses: mxschmitt/action-tmate@v3
|
|
# with:
|
|
# limit-access-to-actor: true |