mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
build: actions update, cache, go1.15-rc1 build
- Use cache to store package versions - Update actions/setup-go to v2 - Add go1.15-rc1 build - Make seperate build step - stop downloading code into special path - leave adding ~/go/bin to PATH to sction/setup-go - remove docker build from xgo as we are building rclone anyway - remove modules setting since it is now always on - use ./... instead of listing files in tests
This commit is contained in:
parent
aa93b39d9b
commit
4f9a80e2d3
53
.github/workflows/build.yml
vendored
53
.github/workflows/build.yml
vendored
@ -19,23 +19,22 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
job_name: ['linux', 'mac', 'windows_amd64', 'windows_386', 'other_os', 'race', 'go1.11', 'go1.12', 'go1.13']
|
job_name: ['linux', 'mac', 'windows_amd64', 'windows_386', 'other_os', 'go1.11', 'go1.12', 'go1.13', 'go1.15']
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- job_name: linux
|
- job_name: linux
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
go: '1.14.x'
|
go: '1.14.x'
|
||||||
modules: 'on'
|
|
||||||
gotags: cmount
|
gotags: cmount
|
||||||
build_flags: '-include "^linux/"'
|
build_flags: '-include "^linux/"'
|
||||||
check: true
|
check: true
|
||||||
quicktest: true
|
quicktest: true
|
||||||
|
racequicktest: true
|
||||||
deploy: true
|
deploy: true
|
||||||
|
|
||||||
- job_name: mac
|
- job_name: mac
|
||||||
os: macOS-latest
|
os: macOS-latest
|
||||||
go: '1.14.x'
|
go: '1.14.x'
|
||||||
modules: 'on'
|
|
||||||
gotags: 'cmount'
|
gotags: 'cmount'
|
||||||
build_flags: '-include "^darwin/amd64" -cgo'
|
build_flags: '-include "^darwin/amd64" -cgo'
|
||||||
quicktest: true
|
quicktest: true
|
||||||
@ -45,7 +44,6 @@ jobs:
|
|||||||
- job_name: windows_amd64
|
- job_name: windows_amd64
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
go: '1.14.x'
|
go: '1.14.x'
|
||||||
modules: 'on'
|
|
||||||
gotags: cmount
|
gotags: cmount
|
||||||
build_flags: '-include "^windows/amd64" -cgo'
|
build_flags: '-include "^windows/amd64" -cgo'
|
||||||
quicktest: true
|
quicktest: true
|
||||||
@ -55,7 +53,6 @@ jobs:
|
|||||||
- job_name: windows_386
|
- job_name: windows_386
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
go: '1.14.x'
|
go: '1.14.x'
|
||||||
modules: 'on'
|
|
||||||
gotags: cmount
|
gotags: cmount
|
||||||
goarch: '386'
|
goarch: '386'
|
||||||
cgo: '1'
|
cgo: '1'
|
||||||
@ -66,58 +63,50 @@ jobs:
|
|||||||
- job_name: other_os
|
- job_name: other_os
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
go: '1.14.x'
|
go: '1.14.x'
|
||||||
modules: 'on'
|
|
||||||
build_flags: '-exclude "^(windows/|darwin/amd64|linux/)"'
|
build_flags: '-exclude "^(windows/|darwin/amd64|linux/)"'
|
||||||
compile_all: true
|
compile_all: true
|
||||||
deploy: true
|
deploy: true
|
||||||
|
|
||||||
- job_name: race
|
|
||||||
os: ubuntu-latest
|
|
||||||
go: '1.14.x'
|
|
||||||
modules: 'on'
|
|
||||||
quicktest: true
|
|
||||||
racequicktest: true
|
|
||||||
|
|
||||||
- job_name: go1.11
|
- job_name: go1.11
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
go: '1.11.x'
|
go: '1.11.x'
|
||||||
modules: 'on'
|
|
||||||
quicktest: true
|
quicktest: true
|
||||||
|
|
||||||
- job_name: go1.12
|
- job_name: go1.12
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
go: '1.12.x'
|
go: '1.12.x'
|
||||||
modules: 'on'
|
|
||||||
quicktest: true
|
quicktest: true
|
||||||
|
|
||||||
- job_name: go1.13
|
- job_name: go1.13
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
go: '1.13.x'
|
go: '1.13.x'
|
||||||
modules: 'on'
|
|
||||||
quicktest: true
|
quicktest: true
|
||||||
|
|
||||||
|
- job_name: go1.15
|
||||||
|
os: ubuntu-latest
|
||||||
|
go: '1.15.0-rc1'
|
||||||
|
quicktest: true
|
||||||
|
racequicktest: true
|
||||||
|
|
||||||
name: ${{ matrix.job_name }}
|
name: ${{ matrix.job_name }}
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
# Checkout into a fixed path to avoid import path problems on go < 1.11
|
fetch-depth: 0
|
||||||
path: ./src/github.com/rclone/rclone
|
|
||||||
|
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
|
stable: 'false'
|
||||||
go-version: ${{ matrix.go }}
|
go-version: ${{ matrix.go }}
|
||||||
|
|
||||||
- name: Set environment variables
|
- name: Set environment variables
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo '::set-env name=GOPATH::${{ runner.workspace }}'
|
|
||||||
echo '::add-path::${{ runner.workspace }}/bin'
|
|
||||||
echo '::set-env name=GO111MODULE::${{ matrix.modules }}'
|
|
||||||
echo '::set-env name=GOTAGS::${{ matrix.gotags }}'
|
echo '::set-env name=GOTAGS::${{ matrix.gotags }}'
|
||||||
echo '::set-env name=BUILD_FLAGS::${{ matrix.build_flags }}'
|
echo '::set-env name=BUILD_FLAGS::${{ matrix.build_flags }}'
|
||||||
if [[ "${{ matrix.goarch }}" != "" ]]; then echo '::set-env name=GOARCH::${{ matrix.goarch }}' ; fi
|
if [[ "${{ matrix.goarch }}" != "" ]]; then echo '::set-env name=GOARCH::${{ matrix.goarch }}' ; fi
|
||||||
@ -167,10 +156,22 @@ jobs:
|
|||||||
printf "\n\nSystem environment:\n\n"
|
printf "\n\nSystem environment:\n\n"
|
||||||
env
|
env
|
||||||
|
|
||||||
- name: Run tests
|
- name: Go module cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
|
- name: Build rclone
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make
|
make
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
make quicktest
|
make quicktest
|
||||||
if: matrix.quicktest
|
if: matrix.quicktest
|
||||||
|
|
||||||
@ -242,9 +243,9 @@ jobs:
|
|||||||
.
|
.
|
||||||
|
|
||||||
- name: Build rclone
|
- name: Build rclone
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker pull golang
|
make
|
||||||
docker run --rm -v "$PWD":/usr/src/rclone -w /usr/src/rclone golang go build -mod=mod -v
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
run: |
|
run: |
|
||||||
|
5
Makefile
5
Makefile
@ -27,7 +27,6 @@ ifndef RELEASE_TAG
|
|||||||
TAG := $(TAG)-beta
|
TAG := $(TAG)-beta
|
||||||
endif
|
endif
|
||||||
GO_VERSION := $(shell go version)
|
GO_VERSION := $(shell go version)
|
||||||
GO_FILES := $(shell go list ./... )
|
|
||||||
ifdef BETA_SUBDIR
|
ifdef BETA_SUBDIR
|
||||||
BETA_SUBDIR := /$(BETA_SUBDIR)
|
BETA_SUBDIR := /$(BETA_SUBDIR)
|
||||||
endif
|
endif
|
||||||
@ -75,10 +74,10 @@ test: rclone test_all
|
|||||||
|
|
||||||
# Quick test
|
# Quick test
|
||||||
quicktest:
|
quicktest:
|
||||||
RCLONE_CONFIG="/notfound" go test $(BUILDTAGS) $(GO_FILES)
|
RCLONE_CONFIG="/notfound" go test $(BUILDTAGS) ./...
|
||||||
|
|
||||||
racequicktest:
|
racequicktest:
|
||||||
RCLONE_CONFIG="/notfound" go test $(BUILDTAGS) -cpu=2 -race $(GO_FILES)
|
RCLONE_CONFIG="/notfound" go test $(BUILDTAGS) -cpu=2 -race ./...
|
||||||
|
|
||||||
# Do source code quality checks
|
# Do source code quality checks
|
||||||
check: rclone
|
check: rclone
|
||||||
|
Loading…
Reference in New Issue
Block a user