Skip to content

Upgrade baton-sdk to v0.1.18 to fix capabilities sorting. #34

Upgrade baton-sdk to v0.1.18 to fix capabilities sorting.

Upgrade baton-sdk to v0.1.18 to fix capabilities sorting. #34

Workflow file for this run

name: ci
on: pull_request
jobs:
go-lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=3m
go-test:
strategy:
matrix:
go-version: [1.20.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: go tests
run: go test -v -covermode=count -json ./... > test.json
- name: annotate go tests
if: always()
uses: guyarb/golang-test-annotations@v0.5.1
with:
test-results: test.json
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: snipeit
MYSQL_USER: snipeit
MYSQL_PASSWORD: userpassword
options: --health-cmd="mysqladmin ping -h localhost -u root --password=rootpassword" --health-interval=10s --health-timeout=5s --health-retries=10
snipe:
image: snipe/snipe-it:latest
ports:
- "8080:80"
env:
APP_ENV: local
APP_DEBUG: true
APP_KEY: base64:Glj2HbPaX9S1R9sOBUgr6MdL4dIR8njbVOoBKDRsGZg=
APP_URL: http://localhost:8080
APP_TIMEZONE: Etc/UTC
APP_LOCALE: en
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: snipeit
MYSQL_USER: snipeit
MYSQL_PASSWORD: userpassword
MYSQL_PORT_3306_TCP_ADDR: mysql
# Docker-specific variables
PHP_UPLOAD_LIMIT: 100
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Install mysql client
run: sudo apt install mysql-client-8.0
- name: Initialize database for snipe-it
run: mysql --host=127.0.0.1 --user=root --password=rootpassword --port=3306 snipeit < test/snipeit.sql
- name: Build baton-snipe-it
run: go build ./cmd/baton-snipe-it
- name: Run baton-snipe-it
env:
BATON_BASE_URL: 'http://localhost:8080'
BATON_ACCESS_TOKEN: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiMTViYjc5MWFlN2JiMDc2MjU0NDNjZGU1ODVjN2FjODAxYWVhNjFmOGIxZWVlNWJkM2ViZGQwNDdiZDVjYjEyZWIwNmY4Y2Y1YTQ0YjU0MjYiLCJpYXQiOjE3MDI0NDkwNDguNTc0OCwibmJmIjoxNzAyNDQ5MDQ4LjU3NDgwNywiZXhwIjoyMzMzNjAxMDQ4LjU2MTg5LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.Hlg-G7BJ1ap5V66wHiRGMJUqVTuElkBoSJ1qlyHz00iZYESZ0zcF8_FmpUhWQKRHierS8LG_bFNhNrtOGK81WSaqYxoLOuKkfQjIpolIDl3IR_IxnaKt1FtXqYfZ_pO1SttQxq6R23eKmjSH-sflfGEvNPIoozjVwV0ouR4PdVJSv9mgvPAVUguhv2xFGEh3KH5YYOxnVAMbeX4qxmhH_RazuguDPtIRq_PmBlntE7FjcZ_YGcVSYM9-xRFYX2-zFT-n_BXp5OsIYLH6dtNaf2ldw1bp2cU1mOVUVvmEZ6WOGpSPs6u4J8d2UHIMd6Pj2x74RGB1cRCNJ_lkmKgM49ox4hGYB5t4PtsGwB9yy9Wka0iqWDOZOHdiaqOTSFDD8zEcq-VYi056QeIfiDeHtDwMqM13L0wqIPwCaZrJTvJ9cE_HH3ST9L7SoP1jR5h5K8P9JXD3L05AiEqUYd0vgmM1r6oZnthzTSmJsqJO4Q_pFQkGLq8cKaL5HiVyiWz0edRd1jVrTvijdgY8vMLQbx3542qMmw8swIksd7F2W5SjThChvcOm_C4c8kx2lBisD5vowWiA8hSBIU28gpkJQpwYOTcYU03c0F9QRVzHpIP0_iiI7Zzz3CtgkGF-RgNR_lI8Xh5hNkRgII7ZI-CHquk_FOppEmFDiGWR1fgDcFo'
run: ./baton-snipe-it
- name: Snipe logs
if: always()
run: docker logs "${{ job.services.snipe.id }}"