Skip to content

Commit

Permalink
Add CI for Windows (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
seachicken authored May 21, 2022
1 parent 874be64 commit 88e4f6c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI for Windows

on:
pull_request:
push:
branches: [main]

jobs:

build:
runs-on: windows-latest

steps:
- name: Prepare git
run: git config --global core.autocrlf false

- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Build
run: go build -v ./...

- name: Checkout dummy repo
uses: actions/checkout@v2
with:
repository: seachicken/can
path: ci-test
fetch-depth: 0

- name: Test
working-directory: ./ci-test
run: |
foreach ($branch in $(git branch --all | findstr /r '\<\s*remotes' | findstr /v /r 'main$')) {
git branch --track $(echo $branch | Select-String -Pattern '.+/(.+$)' | %{$_.matches.groups[1].Value}) "$branch".trim()
}
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
go test .. -v
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Prepare git
run: git config --global core.autocrlf false

- uses: actions/checkout@v2

- name: Set up Go
Expand All @@ -38,7 +35,10 @@ jobs:
- name: Test
working-directory: ./ci-test
run: |
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|main)$'); do git branch --track "${branch##*/}" "$branch"; done
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match 'main$')
do
git branch --track "${branch##*/}" "$branch"
done
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
go test .. -v -race -coverprofile=coverage.out -covermode=atomic
Expand Down

0 comments on commit 88e4f6c

Please sign in to comment.