📝 Update docs (#411) #1851
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test CI | |
on: | |
push: | |
branches: | |
- main | |
- gh-readonly-queue/main/* | |
pull_request: | |
branches: | |
- main | |
jobs: | |
unit-test-sqlite3: | |
name: unit-test-sqlite3 | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
go: ["1.23"] | |
node: ["20"] | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: sigma | |
MYSQL_DATABASE: sigma | |
MYSQL_USER: sigma | |
MYSQL_PASSWORD: sigma | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 | |
postgresql: | |
image: postgres:15-alpine | |
env: | |
POSTGRES_PASSWORD: sigma | |
POSTGRES_USER: sigma | |
POSTGRES_DB: sigma | |
ports: | |
- 5432:5432 | |
options: --health-cmd="pg_isready -U sigma -d sigma || exit 1" --health-interval=10s --health-timeout=5s --health-retries=10 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Setup golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: "yarn" | |
cache-dependency-path: "web/yarn.lock" | |
- name: Build web | |
run: | | |
cd web | |
yarn install --immutable | |
yarn build | |
- name: Setup minio | |
run: | | |
./scripts/run_minio.sh | |
sleep 5 | |
- name: Download cache | |
uses: actions/cache@v4 | |
with: | |
path: /home/runner/.cache/go-build | |
key: ${{ runner.os }}-go-test-sqlite3-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-go-test-sqlite3- | |
- name: Run tests | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
COS_ENDPOINT: ${{ secrets.COS_ENDPOINT_SQLITE }} | |
COS_AK: ${{ secrets.COS_AK }} | |
COS_SK: ${{ secrets.COS_SK }} | |
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }} | |
OSS_AK: ${{ secrets.OSS_AK }} | |
OSS_SK: ${{ secrets.OSS_SK }} | |
OSS_BUCKET: ${{ secrets.OSS_BUCKET_SQLITE }} | |
run: | | |
CI_DATABASE_TYPE=sqlite3 go test -parallel 1 -failfast -tags "timetzdata,exclude_graphdriver_devicemapper,exclude_graphdriver_btrfs,containers_image_openpgp" -timeout 30m -v -coverprofile=coverage.txt -covermode=atomic `go list ./... | grep -v "pkg/tests" | grep -v "pkg/dal/query" | grep -v "pkg/dal/cmd" | grep -v "pkg/types/enums" | grep -v "pkg/handlers/apidocs" | grep -v "pkg/utils/token/mocks" | grep -v "pkg/utils/password/mocks" | grep -v "pkg/handlers/distribution/clients/mocks" | grep -v "pkg/modules/locker/definition/mocks" | grep -v "pkg/signing/definition/mocks" | grep -v "pkg/storage/cos"` | |
- name: Run tests | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
COS_ENDPOINT: ${{ secrets.COS_ENDPOINT_SQLITE }} | |
COS_AK: ${{ secrets.COS_AK }} | |
COS_SK: ${{ secrets.COS_SK }} | |
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }} | |
OSS_AK: ${{ secrets.OSS_AK }} | |
OSS_SK: ${{ secrets.OSS_SK }} | |
OSS_BUCKET: ${{ secrets.OSS_BUCKET_SQLITE }} | |
run: | | |
CI_DATABASE_TYPE=sqlite3 go test -parallel 1 -failfast -tags "timetzdata,exclude_graphdriver_devicemapper,exclude_graphdriver_btrfs,containers_image_openpgp" -timeout 30m -v -coverprofile=coverage.txt -covermode=atomic `go list ./... | grep -v "pkg/tests" | grep -v "pkg/dal/query" | grep -v "pkg/dal/cmd" | grep -v "pkg/types/enums" | grep -v "pkg/handlers/apidocs" | grep -v "pkg/utils/token/mocks" | grep -v "pkg/utils/password/mocks" | grep -v "pkg/handlers/distribution/clients/mocks" | grep -v "pkg/storage/cos" | grep -v "pkg/storage/oss" | grep -v "pkg/modules/locker/definition/mocks" | grep -v "pkg/signing/definition/mocks"` | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unit-test-sqlite3 | |
unit-test-postgresql: | |
name: unit-test-postgresql | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
go: ["1.23"] | |
node: ["20"] | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: sigma | |
MYSQL_DATABASE: sigma | |
MYSQL_USER: sigma | |
MYSQL_PASSWORD: sigma | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 | |
postgresql: | |
image: postgres:15-alpine | |
env: | |
POSTGRES_PASSWORD: sigma | |
POSTGRES_USER: sigma | |
POSTGRES_DB: sigma | |
ports: | |
- 5432:5432 | |
options: --health-cmd="pg_isready -U sigma -d sigma || exit 1" --health-interval=10s --health-timeout=5s --health-retries=10 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Setup golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: "yarn" | |
cache-dependency-path: "web/yarn.lock" | |
- name: Build web | |
run: | | |
cd web | |
yarn install --immutable | |
yarn build | |
- name: Setup minio | |
run: | | |
./scripts/run_minio.sh | |
sleep 5 | |
- name: Download cache | |
uses: actions/cache@v4 | |
with: | |
path: /home/runner/.cache/go-build | |
key: ${{ runner.os }}-go-test-postgresql-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-go-test-postgresql- | |
- name: Run tests | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
COS_ENDPOINT: ${{ secrets.COS_ENDPOINT_POSTGRESQL }} | |
COS_AK: ${{ secrets.COS_AK }} | |
COS_SK: ${{ secrets.COS_SK }} | |
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }} | |
OSS_AK: ${{ secrets.OSS_AK }} | |
OSS_SK: ${{ secrets.OSS_SK }} | |
OSS_BUCKET: ${{ secrets.OSS_BUCKET_POSTGRESQL }} | |
run: | | |
CI_DATABASE_TYPE=postgresql go test -parallel 1 -failfast -tags "timetzdata,exclude_graphdriver_devicemapper,exclude_graphdriver_btrfs,containers_image_openpgp" -timeout 30m -v -coverprofile=coverage.txt -covermode=atomic `go list ./... | grep -v "pkg/tests" | grep -v "pkg/dal/query" | grep -v "pkg/dal/cmd" | grep -v "pkg/types/enums" | grep -v "pkg/handlers/apidocs" | grep -v "pkg/utils/token/mocks" | grep -v "pkg/utils/password/mocks" | grep -v "pkg/handlers/distribution/clients/mocks" | grep -v "pkg/modules/locker/definition/mocks" | grep -v "pkg/signing/definition/mocks" | grep -v "pkg/storage/cos"` | |
- name: Run tests | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
COS_ENDPOINT: ${{ secrets.COS_ENDPOINT_POSTGRESQL }} | |
COS_AK: ${{ secrets.COS_AK }} | |
COS_SK: ${{ secrets.COS_SK }} | |
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }} | |
OSS_AK: ${{ secrets.OSS_AK }} | |
OSS_SK: ${{ secrets.OSS_SK }} | |
OSS_BUCKET: ${{ secrets.OSS_BUCKET_POSTGRESQL }} | |
run: | | |
CI_DATABASE_TYPE=postgresql go test -parallel 1 -failfast -tags "timetzdata,exclude_graphdriver_devicemapper,exclude_graphdriver_btrfs,containers_image_openpgp" -timeout 30m -v -coverprofile=coverage.txt -covermode=atomic `go list ./... | grep -v "pkg/tests" | grep -v "pkg/dal/query" | grep -v "pkg/dal/cmd" | grep -v "pkg/types/enums" | grep -v "pkg/handlers/apidocs" | grep -v "pkg/utils/token/mocks" | grep -v "pkg/utils/password/mocks" | grep -v "pkg/handlers/distribution/clients/mocks" | grep -v "pkg/storage/cos" | grep -v "pkg/storage/oss" | grep -v "pkg/modules/locker/definition/mocks" | grep -v "pkg/signing/definition/mocks"` | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unit-test-postgresql | |
unit-test-mysql: | |
name: unit-test-mysql | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
go: ["1.23"] | |
node: ["20"] | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: sigma | |
MYSQL_DATABASE: sigma | |
MYSQL_USER: sigma | |
MYSQL_PASSWORD: sigma | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 | |
postgresql: | |
image: postgres:15-alpine | |
env: | |
POSTGRES_PASSWORD: sigma | |
POSTGRES_USER: sigma | |
POSTGRES_DB: sigma | |
ports: | |
- 5432:5432 | |
options: --health-cmd="pg_isready -U sigma -d sigma || exit 1" --health-interval=10s --health-timeout=5s --health-retries=10 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Setup golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: "yarn" | |
cache-dependency-path: "web/yarn.lock" | |
- name: Build web | |
run: | | |
cd web | |
yarn install --immutable | |
yarn build | |
- name: Setup minio | |
run: | | |
./scripts/run_minio.sh | |
sleep 5 | |
- name: Download cache | |
uses: actions/cache@v4 | |
with: | |
path: /home/runner/.cache/go-build | |
key: ${{ runner.os }}-go-test-mysql-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-go-test-mysql- | |
- name: Run tests | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
COS_ENDPOINT: ${{ secrets.COS_ENDPOINT_MYSQL }} | |
COS_AK: ${{ secrets.COS_AK }} | |
COS_SK: ${{ secrets.COS_SK }} | |
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }} | |
OSS_AK: ${{ secrets.OSS_AK }} | |
OSS_SK: ${{ secrets.OSS_SK }} | |
OSS_BUCKET: ${{ secrets.OSS_BUCKET_MYSQL }} | |
run: | | |
CI_DATABASE_TYPE=mysql go test -parallel 1 -failfast -tags "timetzdata,exclude_graphdriver_devicemapper,exclude_graphdriver_btrfs,containers_image_openpgp" -timeout 30m -v -coverprofile=coverage.txt -covermode=atomic `go list ./... | grep -v "pkg/tests" | grep -v "pkg/dal/query" | grep -v "pkg/dal/cmd" | grep -v "pkg/types/enums" | grep -v "pkg/handlers/apidocs" | grep -v "pkg/utils/token/mocks" | grep -v "pkg/utils/password/mocks" | grep -v "pkg/handlers/distribution/clients/mocks" | grep -v "pkg/modules/locker/definition/mocks" | grep -v "pkg/signing/definition/mocks" | grep -v "pkg/storage/cos"` | |
- name: Run tests | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
COS_ENDPOINT: ${{ secrets.COS_ENDPOINT_MYSQL }} | |
COS_AK: ${{ secrets.COS_AK }} | |
COS_SK: ${{ secrets.COS_SK }} | |
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }} | |
OSS_AK: ${{ secrets.OSS_AK }} | |
OSS_SK: ${{ secrets.OSS_SK }} | |
OSS_BUCKET: ${{ secrets.OSS_BUCKET_MYSQL }} | |
run: | | |
CI_DATABASE_TYPE=mysql go test -parallel 1 -failfast -tags "timetzdata,exclude_graphdriver_devicemapper,exclude_graphdriver_btrfs,containers_image_openpgp" -timeout 30m -v -coverprofile=coverage.txt -covermode=atomic `go list ./... | grep -v "pkg/tests" | grep -v "pkg/dal/query" | grep -v "pkg/dal/cmd" | grep -v "pkg/types/enums" | grep -v "pkg/handlers/apidocs" | grep -v "pkg/utils/token/mocks" | grep -v "pkg/utils/password/mocks" | grep -v "pkg/handlers/distribution/clients/mocks" | grep -v "pkg/storage/cos" | grep -v "pkg/storage/oss" | grep -v "pkg/modules/locker/definition/mocks" | grep -v "pkg/signing/definition/mocks"` | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unit-test-mysql |