Skip to content
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
12 changes: 3 additions & 9 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
go-version-file: go.mod

- name: Install Goreleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "v2.8.2"
install-only: true

- name: Build railcar binaries
run: make railcar-build-binaries
- name: make placeholder assets
run: make asset-placeholders

- name: golangci-lint
uses: golangci/golangci-lint-action@v7
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit tests

on:
pull_request: # triggers on every push to a PR

permissions:
contents: read # checkout needs this

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
# Reads version from go.mod; override with a specific version if you prefer
go-version-file: go.mod

- name: make placeholder assets
run: make asset-placeholders

- name: Run unit tests with the race detector
run: make test-go
26 changes: 23 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,30 @@ build-all: railcar-build-binaries build-freight
railcar-build-binaries:
goreleaser release --snapshot --clean --config=./assets/.goreleaser.yaml

.Phony: go-test
go-test:
.Phony: test-go
test-go:
go test ./... --race

.Phony: lint
lint:
golangci-lint run
golangci-lint run


.Phony: asset-placeholders
asset-placeholders:
mkdir -p assets/dist/conductor_darwin_amd64_v1 \
assets/dist/conductor_darwin_arm64_v8.0 \
assets/dist/conductor_linux_amd64_v1 \
assets/dist/conductor_linux_arm64_v8.0 \
assets/dist/conductor_linux_arm_6 \
assets/dist/conductor_windows_amd64_v1 \
assets/dist/conductor_windows_arm64_v8.0 \
assets/dist/conductor_windows_arm_6
touch assets/dist/conductor_darwin_amd64_v1/conductor \
assets/dist/conductor_darwin_arm64_v8.0/conductor \
assets/dist/conductor_linux_amd64_v1/conductor \
assets/dist/conductor_linux_arm64_v8.0/conductor \
assets/dist/conductor_linux_arm_6/conductor \
assets/dist/conductor_windows_amd64_v1/conductor.exe \
assets/dist/conductor_windows_arm64_v8.0/conductor.exe \
assets/dist/conductor_windows_arm_6/conductor.exe