Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ name: Commit
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
commits:
name: Check Commits
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: free disk space
uses: jlumbroso/free-disk-space@ceedf095f4ec1a097402bc6bd80831f2e1a6fde6 # v2.0.0
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
name: Pre-commit Checks
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

Expand Down
107 changes: 100 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@ name: Tests
on:
pull_request:
workflow_dispatch:
inputs:
core_tag:
description: Core release tag to qualify, for example v1.25.0-beta.8. Leave empty to skip qualification.
required: false
type: string
provider_tag:
description: Published SSH provider release to qualify
required: false
default: v1.1.47
type: string

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
test:
name: Run Integration Tests
name: Integration tests (compatibility core v1.24.0, not release qualification)
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
Expand All @@ -22,7 +40,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y bash zsh fish openssh-server

- name: unit tests
run: go test -race -covermode=atomic . ./cmd/... ./hack/... ./pkg/...
run: go test -race -covermode=atomic . ./cmd/... ./hack/... ./pkg/... ./e2e/qualification/...
env:
CGO_ENABLED: "1"

Expand All @@ -44,11 +62,7 @@ jobs:
du -sh "$(go env GOCACHE)" "$(go env GOMODCACHE)"

- name: provision login shell accounts
run: |
sudo service ssh start
for shell in bash zsh fish; do
sudo useradd --create-home --shell "$(command -v "$shell")" "devsy-$shell"
done
run: go run ./hack/ci provision-accounts

- name: integration tests
working-directory: ./e2e
Expand All @@ -59,6 +73,7 @@ jobs:
windows-stdin:
name: Windows redirected SSH stdin
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
Expand All @@ -68,3 +83,81 @@ jobs:
go-version-file: go.mod
- name: test redirected pipe bytes and cancellation
run: go test ./pkg/ssh -run TestWindows -timeout 60s

release-qualification:
name: Release qualification (${{ matrix.core_artifact }}, explicit pair)
if: github.event_name == 'workflow_dispatch' && inputs.core_tag != ''
runs-on: ubuntu-24.04
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
core_artifact: [cli, desktop]
env:
CORE_TAG: ${{ inputs.core_tag }}
CORE_REPO: devsy-org/devsy
PROVIDER_TAG: ${{ inputs.provider_tag }}
CORE_ARTIFACT: ${{ matrix.core_artifact }}
PROVIDER_FIX_SHA: d31fed1b2695861b76e922c530ad8a2436f5acb9
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false

- name: choose the qualification artifact directory
run: echo "QUALIFICATION_DIR=$RUNNER_TEMP/qualification" >> "$GITHUB_ENV"

- name: setup Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod

- name: resolve and verify the candidate core
run: go run ./hack/ci qualify-core
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: install login shells
run: sudo apt-get update && sudo apt-get install -y bash zsh fish openssh-server

- name: download and verify the released provider
run: go run ./hack/ci verify-provider
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: require the explicit candidate before SSH setup
run: go run ./hack/ci missing-candidate-guard
env:
DEVSY_E2E_RELEASE_QUALIFICATION: "true"

- name: provision qualification accounts
run: go run ./hack/ci provision-qualification-accounts

- name: qualify login shells with the explicit pair
working-directory: ./e2e
run: >-
go test -v -ginkgo.v -timeout 14400s
--ginkgo.label-filter='release-qualification || provider-command'
env:
DEVSY_E2E_RELEASE_QUALIFICATION: "true"
DEVSY_E2E_SHELL_MATRIX: "true"
DEVSY_E2E_REPORT: ${{ runner.temp }}/qualification/qualification-report.json

- name: remove qualification accounts and sudo fixture
if: always()
run: go run ./hack/ci cleanup-qualification-accounts

- name: verify the qualification report
run: go run ./hack/ci verify-report

- name: upload qualification report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: release-qualification-${{ inputs.core_tag }}-${{ matrix.core_artifact }}
path: |
${{ runner.temp }}/qualification/pair-verification.txt
${{ runner.temp }}/qualification/qualification-report.json
${{ runner.temp }}/qualification/missing-binary-guard.log
if-no-files-found: error
18 changes: 18 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ linters:
- unparam
- unused
- whitespace
exclusions:
rules:
- path: 'hack/ci/(qualify|verify_provider)\.go'
linters:
- gosec
text: 'G302: Expect file permissions to be 0600 or less'
- path: 'hack/ci/(exec|guard)\.go'
linters:
- gosec
text: 'G204|G702'
- path: 'hack/ci/provision_test\.go'
linters:
- gosec
text: 'G703'
- path: 'e2e/qualification/report\.go'
linters:
- gosec
text: 'G304'
settings:
cyclop:
max-complexity: 8
Expand Down
Loading
Loading