ooni-probe-cli/.github/workflows/linux.yml
Simone Basso 89a584f93b
fix(go-build-alpine): honour OONI_PSIPHON_TAGS (#968)
Closes https://github.com/ooni/probe/issues/2334.

While there, reinstate integration tests, which were also lost in a previous refactoring. However, only run those tests for linux/amd64 because we can be confident that the Go compiler is WAI for all archs we support.

While there, always use bash for running end-to-end tests.

H/T @ainghazal for discovering and reporting this bug.
2022-10-03 11:55:47 +02:00

183 lines
5.6 KiB
YAML

# Builds and publishes ooniprobe and miniooni for Linux
name: linux
on:
push:
branches:
- "release/**"
- "fullbuild"
- "linuxbuild"
tags:
- "v*"
schedule:
- cron: "17 1 * * *"
jobs:
build_and_publish_386:
runs-on: "ubuntu-20.04"
permissions: # See https://github.com/ooni/probe/issues/2154
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- 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 }}
- uses: actions/cache@v3
with:
path: GOCACHE
key: linux-build-cache-386
- run: make CLI/linux-static-386
- run: ./E2E/ooniprobe.bash ./CLI/ooniprobe-linux-386
- run: ./script/ghpublish.bash ./CLI/ooniprobe-linux-386 ./CLI/miniooni-linux-386
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_publish_amd64:
runs-on: "ubuntu-20.04"
permissions: # See https://github.com/ooni/probe/issues/2154
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- 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 }}
- uses: actions/cache@v3
with:
path: GOCACHE
key: linux-build-cache-amd64
- run: make CLI/linux-static-amd64
- run: ./E2E/ooniprobe.bash ./CLI/ooniprobe-linux-amd64
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: magnetikonline/action-golang-cache@v2
with:
go-version: "${{ steps.goversion.outputs.version }}"
cache-key-suffix: "-windows-${{ steps.goversion.outputs.version }}"
- run: sudo apt-get update -q
- run: sudo apt-get install -y tor
- run: ./E2E/miniooni.bash ./CLI/miniooni-linux-amd64
- run: ./script/ghpublish.bash ./CLI/ooniprobe-linux-amd64 ./CLI/miniooni-linux-amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_publish_armv6:
runs-on: "ubuntu-20.04"
permissions: # See https://github.com/ooni/probe/issues/2154
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: sudo apt-get update -q
- run: sudo apt-get install -y qemu-user-static
- 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 }}
- uses: actions/cache@v3
with:
path: GOCACHE
key: linux-build-cache-armv6
- run: make CLI/linux-static-armv6
- run: ./E2E/ooniprobe.bash ./CLI/ooniprobe-linux-armv6
- run: ./script/ghpublish.bash ./CLI/ooniprobe-linux-armv6 ./CLI/miniooni-linux-armv6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_publish_armv7:
runs-on: "ubuntu-20.04"
permissions: # See https://github.com/ooni/probe/issues/2154
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: sudo apt-get update -q
- run: sudo apt-get install -y qemu-user-static
- 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 }}
- uses: actions/cache@v3
with:
path: GOCACHE
key: linux-build-cache-armv7
- run: make CLI/linux-static-armv7
- run: ./E2E/ooniprobe.bash ./CLI/ooniprobe-linux-armv7
- run: ./script/ghpublish.bash ./CLI/ooniprobe-linux-armv7 ./CLI/miniooni-linux-armv7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_publish_arm64:
runs-on: "ubuntu-20.04"
permissions: # See https://github.com/ooni/probe/issues/2154
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: sudo apt-get update -q
- run: sudo apt-get install -y qemu-user-static
- 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 }}
- uses: actions/cache@v3
with:
path: GOCACHE
key: linux-build-cache-arm64
- run: make CLI/linux-static-arm64
- run: ./E2E/ooniprobe.bash ./CLI/ooniprobe-linux-arm64
- run: ./script/ghpublish.bash ./CLI/ooniprobe-linux-arm64 ./CLI/miniooni-linux-arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}