mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 02:16:28 +02:00
* upgrade to go v1.24 * add a macOS-specific //nolint comment too --------- Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
148 lines
4.2 KiB
YAML
148 lines
4.2 KiB
YAML
name: Test
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
integration:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: [22.x]
|
|
platform: [ubuntu-22.04]
|
|
deployment: [multi, single]
|
|
authenticate-flow: [stateful, stateless]
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
|
|
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
|
|
with:
|
|
go-version: 1.24.x
|
|
cache: false
|
|
|
|
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: yarn
|
|
cache-dependency-path: ui/yarn.lock
|
|
|
|
- name: set env vars
|
|
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
|
|
|
- name: build dev docker image
|
|
run: |
|
|
./scripts/build-dev-docker.bash
|
|
|
|
- name: start cluster
|
|
run: |
|
|
export POMERIUM_TAG=dev
|
|
cd ./integration/clusters/${{matrix.deployment}}-${{matrix.authenticate-flow}}
|
|
docker compose up -d
|
|
|
|
- name: integration tests
|
|
run: |
|
|
(cd ./integration/clusters/${{matrix.deployment}}-${{matrix.authenticate-flow}} && docker compose logs -f &)
|
|
go test -v ./integration/...
|
|
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.23.x]
|
|
node-version: [22.x]
|
|
platform: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
|
|
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
|
|
with:
|
|
go-version: 1.24.x
|
|
|
|
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: yarn
|
|
cache-dependency-path: ui/yarn.lock
|
|
|
|
- name: build
|
|
run: |
|
|
make build-deps
|
|
make build
|
|
|
|
- name: save binary
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
with:
|
|
path: bin/pomerium*
|
|
name: pomerium ${{ github.run_id }} ${{ matrix.platform }}
|
|
retention-days: 1
|
|
|
|
- name: test
|
|
run: make cover
|
|
|
|
- uses: jandelgado/gcov2lcov-action@4e1989767862652e6ca8d3e2e61aabe6d43be28b
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
name: convert coverage to lcov
|
|
with:
|
|
infile: coverage.txt
|
|
outfile: coverage.lcov
|
|
|
|
- name: upload to coveralls
|
|
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
path-to-lcov: coverage.lcov
|
|
|
|
build-docker:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
|
|
|
|
- name: Docker Build
|
|
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: false
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
precommit:
|
|
runs-on: ubuntu-22.04
|
|
if: github.event_name == 'pull_request'
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
|
|
with:
|
|
go-version: 1.24.x
|
|
cache: false
|
|
|
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
|
|
with:
|
|
extra_args: --show-diff-on-failure --from-ref ${{
|
|
github.event.pull_request.base.sha }} --to-ref ${{
|
|
github.event.pull_request.head.sha }}
|
|
env:
|
|
SKIP: lint
|
|
|
|
check-docker-images:
|
|
runs-on: ubuntu-22.04
|
|
if: github.event_name == 'pull_request'
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- run: ./scripts/check-docker-images
|