Skip to content

Commit

Permalink
CI: Run check tests & build on windows (#161)
Browse files Browse the repository at this point in the history
* CI: Run check tests & build on windows

* Trying to fix error get .out

* Added macos & release compilation flags
  • Loading branch information
SchawnnDev authored May 15, 2024
1 parent e01607f commit faa6a3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

strategy:
matrix:
os: [ ubuntu-latest ] # [windows-latest, ubuntu-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest] # [windows-latest, ubuntu-latest, macos-latest]

steps:
- name: Checkout code
Expand All @@ -66,7 +66,7 @@ jobs:

strategy:
matrix:
os: [ ubuntu-latest ] # [windows-latest, ubuntu-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest] # [windows-latest, ubuntu-latest, macos-latest]

steps:
- name: Checkout code
Expand All @@ -79,7 +79,7 @@ jobs:

- name: Run tests with code coverage
run: |
go test -coverprofile=coverage.out ./...
go test -v ./... -coverprofile=coverage.out
- name: Upload coverage artifact
if: github.event_name == 'push'
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ jobs:
- name: Installing Go dependency
run: go get -v -t -d ./...

- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV

- name: Build for Windows
run: GOOS=windows GOARCH=amd64 go build -o emf-cli-windows-amd64.exe
run: GOOS=windows GOARCH=amd64 go build -o emf-cli-windows-amd64.exe -a -trimpath -ldflags "-X main.Version=${{ github.ref }}-0 -X main.BuildDate=${{ env.NOW }}"

- name: Build for Mac
run: GOOS=darwin GOARCH=amd64 go build -o emf-cli-darwin-amd64
run: GOOS=darwin GOARCH=amd64 go build -o emf-cli-darwin-amd64 -a -trimpath -ldflags "-X main.Version=${{ github.ref }}-0 -X main.BuildDate=${{ env.NOW }}"

- name: Build for Linux
run: GOOS=linux GOARCH=amd64 go build -o emf-cli-linux-amd64
run: GOOS=linux GOARCH=amd64 go build -o emf-cli-linux-amd64 -a -trimpath -ldflags "-X main.Version=${{ github.ref }}-0 -X main.BuildDate=${{ env.NOW }}"

- name: Create Release
id: create_release
Expand Down

0 comments on commit faa6a3e

Please sign in to comment.