cleanup: define required Go version just once (#861)

See https://github.com/ooni/probe/issues/2217
This commit is contained in:
Simone Basso
2022-08-17 11:39:38 +02:00
committed by GitHub
parent 6a0ae5c70b
commit 3cc2ce0b81
22 changed files with 169 additions and 57 deletions
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: go test -race -tags shaping ./...
+8 -4
View File
@@ -14,14 +14,18 @@ jobs:
contents: write
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "${{ steps.goversion.outputs.version }}"
- run: |
echo -n $PSIPHON_CONFIG_KEY > ./internal/engine/psiphon-config.key
echo $PSIPHON_CONFIG_JSON_AGE_BASE64 | base64 -d > ./internal/engine/psiphon-config.json.age
+11 -7
View File
@@ -10,17 +10,21 @@ on:
jobs:
measure_coverage:
runs-on: ubuntu-20.04
strategy:
matrix:
go:
- "1.18.3"
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: magnetikonline/action-golang-cache@v2
with:
go-version: "${{ matrix.go }}"
cache-key-suffix: "-coverage-${{ matrix.go }}"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
cache-key-suffix: "-coverage-${{ steps.goversion.outputs.version }}"
- run: go test -short -race -tags shaping -coverprofile=probe-cli.cov ./...
- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: probe-cli.cov
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: go generate ./...
+8 -4
View File
@@ -11,14 +11,18 @@ jobs:
runs-on: ubuntu-20.04
env:
GO111MODULE: on
strategy:
matrix:
go:
- "1.18.3"
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "${{ steps.goversion.outputs.version }}"
- name: Run Gosec security scanner
continue-on-error: true # TODO(https://github.com/ooni/probe/issues/2180)
uses: securego/gosec@master
+8 -3
View File
@@ -14,13 +14,18 @@ jobs:
contents: write
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "${{ steps.goversion.outputs.version }}"
- run: |
echo -n $PSIPHON_CONFIG_KEY > ./internal/engine/psiphon-config.key
echo $PSIPHON_CONFIG_JSON_AGE_BASE64 | base64 -d > ./internal/engine/psiphon-config.json.age
+9 -2
View File
@@ -9,9 +9,16 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: go build -v ./internal/cmd/jafar
- run: sudo ./testjafar.bash
+12 -3
View File
@@ -13,19 +13,28 @@ jobs:
permissions: # See https://github.com/ooni/probe/issues/2154
contents: write
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "${{ steps.goversion.outputs.version }}"
- run: |
echo -n $PSIPHON_CONFIG_KEY > ./internal/engine/psiphon-config.key
echo $PSIPHON_CONFIG_JSON_AGE_BASE64 | base64 -d > ./internal/engine/psiphon-config.json.age
env:
PSIPHON_CONFIG_KEY: ${{ secrets.PSIPHON_CONFIG_KEY }}
PSIPHON_CONFIG_JSON_AGE_BASE64: ${{ secrets.PSIPHON_CONFIG_JSON_AGE_BASE64 }}
- run: ./mk ./CLI/ooniprobe-darwin
- run: ./E2E/ooniprobe.sh ./CLI/ooniprobe-darwin-amd64
- run: |
+8 -4
View File
@@ -19,14 +19,18 @@ jobs:
contents: write
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "${{ steps.goversion.outputs.version }}"
- run: |
echo -n $PSIPHON_CONFIG_KEY > ./internal/engine/psiphon-config.key
echo $PSIPHON_CONFIG_JSON_AGE_BASE64 | base64 -d > ./internal/engine/psiphon-config.json.age
+10 -4
View File
@@ -14,14 +14,20 @@ jobs:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
go: [ "1.18.3" ]
os: [ "ubuntu-20.04", "windows-2019", "macos-10.15" ]
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
shell: bash
- uses: magnetikonline/action-golang-cache@v2
with:
go-version: "${{ matrix.go }}"
cache-key-suffix: "-coverage-${{ matrix.go }}"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
cache-key-suffix: "-coverage-${{ steps.goversion.outputs.version }}"
# The first test compiles and links against libc and uses getaddrinfo
- run: go test -race ./internal/netxlite/...
+6 -1
View File
@@ -14,9 +14,14 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
go-version: "${{ steps.goversion.outputs.version }}"
- name: build oohelperd binary
run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ./CLI/oohelperd-linux-amd64 -v -tags netgo -ldflags="-s -w -extldflags -static" ./internal/cmd/oohelperd
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: ./QA/rundocker.bash "fbmessenger"
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: ./QA/rundocker.bash "hhfm"
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: ./QA/rundocker.bash "hirl"
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: ./QA/rundocker.bash "telegram"
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: ./QA/rundocker.bash "webconnectivity"
+8 -2
View File
@@ -9,8 +9,14 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
go-version: "${{ steps.goversion.outputs.version }}"
- run: ./QA/rundocker.bash "whatsapp"
+9 -3
View File
@@ -16,15 +16,21 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
go-version: "${{ steps.goversion.outputs.version }}"
- name: Generate release tarball
run: |
VERSION=${GITHUB_REF_NAME#v}
go mod vendor
tar czf ooni-probe-cli-${VERSION}.tar.gz --transform "s,^,ooni-probe-cli-${VERSION}/," *
- name: Upload release tarball
run: |
gh release create -p $GITHUB_REF_NAME --target $GITHUB_SHA || true
+12 -3
View File
@@ -11,12 +11,18 @@ jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.18.3"
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v1
with:
go-version: "${{ steps.goversion.outputs.version }}"
- run: sudo apt install mingw-w64
- run: |
echo -n $PSIPHON_CONFIG_KEY > ./internal/engine/psiphon-config.key
@@ -24,11 +30,14 @@ jobs:
env:
PSIPHON_CONFIG_KEY: ${{ secrets.PSIPHON_CONFIG_KEY }}
PSIPHON_CONFIG_JSON_AGE_BASE64: ${{ secrets.PSIPHON_CONFIG_JSON_AGE_BASE64 }}
- run: ./mk MINGW_W64_VERSION="9.3-win32" ./CLI/ooniprobe-windows
- uses: actions/upload-artifact@v2
with:
name: ooniprobe-windows-amd64.exe
path: ./CLI/ooniprobe-windows-amd64.exe
- uses: actions/upload-artifact@v2
with:
name: ooniprobe-windows-386.exe