Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add matrix strategy builds #14

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/workflows/back-compat-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,34 @@ env:
jobs:
check-back-compat:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: build head
run: |
go build -o hours_head
cp hours_head /var/tmp
- uses: actions/checkout@v4
with:
ref: main
- name: build main
run: |
go build -o hours_main
cp hours_main /var/tmp
rm hours_main
- uses: actions/checkout@v4
- name: build head
run: |
go build -o hours_head
cp hours_head /var/tmp
rm hours_head
- name: Run last version
run: |
/var/tmp/hours_main --dbpath=/var/tmp/throwaway.db log today -p
/var/tmp/hours_main --dbpath=/var/tmp/throwaway-1.db report 3d -p
/var/tmp/hours_main --dbpath=/var/tmp/throwaway-2.db gen -y
- name: Run current version
run: |
/var/tmp/hours_head --dbpath=/var/tmp/throwaway.db log today -p
/var/tmp/hours_head --dbpath=/var/tmp/throwaway-1.db report 3d -p
/var/tmp/hours_head --dbpath=/var/tmp/throwaway-2.db report 3d -p
29 changes: 18 additions & 11 deletions .github/workflows/back-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,35 @@ env:
jobs:
check-back-compat:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: git checkout HEAD~1
- name: build last commit
run: |
go build -o hours_prev
cp hours_prev /var/tmp
rm hours_prev
- run: git checkout main
- name: build head
run: |
go build -o hours_head
cp hours_head /var/tmp
rm hours_head
- run: git checkout HEAD~1
- name: build main
run: |
go build -o hours_prev
cp hours_prev /var/tmp
- name: Run last version
run: |
/var/tmp/hours_prev --dbpath=/var/tmp/throwaway.db log today -p
/var/tmp/hours_prev --dbpath=/var/tmp/throwaway-1.db report 3d -p
/var/tmp/hours_prev --dbpath=/var/tmp/throwaway-2.db gen -y
- name: Run current version
run: |
/var/tmp/hours_head --dbpath=/var/tmp/throwaway.db log today -p
/var/tmp/hours_head --dbpath=/var/tmp/throwaway-1.db report 3d -p
/var/tmp/hours_head --dbpath=/var/tmp/throwaway-2.db report 3d -p
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ env:
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
Expand All @@ -36,6 +39,6 @@ jobs:
- name: run hours
run: |
go build .
./hours --dbpath=/var/tmp/throwaway-1.db log today -p
./hours --dbpath=/var/tmp/throwaway-1.db report 3d -p
./hours --dbpath=/var/tmp/throwaway-2.db gen -y
./hours --dbpath=/var/tmp/throwaway-2.db report 3d -p
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: lint

on:
push:
branches: [ "main" ]
pull_request:
paths:
- "go.*"
- "**/*.go"
- ".github/workflows/*.yml"

permissions:
contents: read

env:
GO_VERSION: '1.22.5'

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58
Loading