Skip to content

Commit

Permalink
github action
Browse files Browse the repository at this point in the history
  • Loading branch information
RyuaNerin committed Jun 21, 2024
1 parent 47cb736 commit 038c609
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 125 deletions.
65 changes: 0 additions & 65 deletions .github/workflows/go-test.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/golangci-lint.yaml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/lint-and-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Lint

on:
push:
pull_request:

permissions:
contents: read
pull-requests: read
checks: write

jobs:
golangci-lint:
strategy:
matrix:
go-version:
- '1.15'
- '1.16'
- '1.17'
- '1.18'
- '1.19'
- '1.20'
- '1.21'
- '1.22'

runs-on:
- ubuntu-latest
- [ 'macOS', 'self-hosted', 'lint' ]
- windows-latest

exclude:
- runs-on: [ 'macOS', 'self-hosted', 'lint' ]
go-version: '1.15'

runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v4

- name: Set git to use LF
run: |
git config core.autocrlf false
git rm --cached -r .
git reset --hard
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.0

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.0
args: --build-tags purego

go-test:
needs: golangci-lint

if: github.ref == 'refs/heads/master'

strategy:
matrix:
go-version:
- '1.15'
- '1.16'
- '1.17'
- '1.18'
- '1.19'
- '1.20'
- '1.21'
- '1.22'

runs-on:
- ubuntu-latest
- [ 'macOS', 'self-hosted' ]
- windows-latest

exclude:
- runs-on: [ 'macOS', 'self-hosted' ]
go-version: '1.15'

runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v4

- name: Set git to use LF
run: |
git config core.autocrlf false
git rm --cached -r .
git reset --hard
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: go.sum

- name: Install dependencies
run: |
go get .
go get github.com/RyuaNerin/elliptic2@v1.0.0
go get github.com/RyuaNerin/testingutil@v0.1.0
- name: Build
run: go build -v ./...

- name: Test (purego)
run: go test --tags=purego ./...
# run: go test -test.short --tags=purego ./...

- name: Test
run: go test ./...
# run: go test -test.short ./...

0 comments on commit 038c609

Please sign in to comment.