Skip to content

Commit

Permalink
fork sync fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arkavo-com committed Apr 28, 2024
1 parent 5f7b18e commit 127d1cb
Show file tree
Hide file tree
Showing 64 changed files with 485 additions and 2,249 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/analyze.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This GitHub action will check that the developer tools are run
# This checks code quality
# https://github.com/golangci/golangci-lint-action
# act --secret-file act.env --container-architecture linux/amd64 --workflows .github/workflows/analyze.yaml
name: analyze
on:
push:
permissions:
contents: read
jobs:
lint:
name: lint
strategy:
matrix:
go: ['1.22']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
# Run golangci-lint tool against configuration .golangci.yaml
# https://github.com/marketplace/actions/run-golangci-lint
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
# This job will build the run go test with coverage
coverage:
name: coverage
strategy:
matrix:
go: ['1.22']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
# Run go test with coverage
- name: coverprofile
run: go test ./... -coverprofile=./cover.out
# Run go test with coverage
# https://github.com/marketplace/actions/go-test-coverage
- name: go-test-coverage
uses: vladopajic/go-test-coverage@v2
with:
# Configure action by specifying input parameters individually (option 2)
profile: cover.out
local-prefix: ${{ github.repository }}
threshold-file: 0
threshold-package: 20
threshold-total: 25

# TODO
# # test and benchmark
# RUN go test -bench=. -benchmem ./...
# # race condition
# RUN CGO_ENABLED=1 GOOS=linux go build -v -a -race -installsuffix cgo -o . ./...
66 changes: 0 additions & 66 deletions .github/workflows/nightly-build.yaml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/process.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This GitHub action will check the developer process
# act --secret-file act.env --container-architecture linux/amd64 --workflows .github/workflows/process.yaml
name: process
on:
pull_request:
branches: [ main ]

jobs:
check-version:
runs-on: ubuntu-latest
steps:
# This step will checkout the source code of the pull request branch
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
# This step will read the version number from the VERSION file in the pull request branch
# and store it as an output variable named version
- name: Read VERSION file from pull request branch
id: version-pr
run: echo "::set-output name=version::$(cat VERSION)"
# This step will read the version number from the VERSION file in the base branch
# and store it as an output variable named version
- name: Read VERSION file from base branch
id: version-base
run: |
git checkout ${{ github.base_ref }}
echo "::set-output name=version::$(cat VERSION)"
- name: View context attributes
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: console.log(context)
- run: npm install semver
# This step will compare the version numbers using a semantic versioning library
# and set the action status to failed if the version number in the pull request branch
# is not valid or not greater than the one in the base branch
- name: Compare version numbers
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const semver = require('semver')
const versionPr = '${{ steps.version-pr.outputs.version }}'
const versionBase = '${{ steps.version-base.outputs.version }}'
if (!semver.valid(versionPr)) {
const reason = `Invalid version number: ${versionPr}`
// requires authorization
// github.rest.pulls.createReviewComment({
// owner: context.repo.owner,
// repo: context.repo.repo,
// pull_number: context.runId,
// body: reason,
// commit_id: context.sha,
// path: "VERSION",
// line: 1
// });
core.setFailed(reason)
} else if (!semver.gt(versionPr, versionBase)) {
const reason = `Version number not incremented: ${versionPr} <= ${versionBase}`
// github.rest.pulls.createReviewComment({
// owner: context.repo.owner,
// repo: context.repo.repo,
// pull_number: context.runId,
// body: reason,
// commit_id: context.sha,
// path: "VERSION",
// line: 1
// });
core.setFailed(reason)
} else {
console.log(`Version number OK: ${versionPr} > ${versionBase}`)
}
22 changes: 0 additions & 22 deletions .github/workflows/release.yaml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/sonarcloud.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@ tmp-gen/
*.zip
sensitive.txt.tdf
/act.env
/service/kas-cert.pem
/service/kas-ec-cert.pem
/service/kas-ec-private.pem
/service/kas-private.pem
/ca.crt
/pep.crt
/pep.json
/pep.key
/server.crt
/server.json
/server.key
12 changes: 8 additions & 4 deletions examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
module github.com/opentdf/platform/examples
module github.com/arkavo-org/opentdf-platform/examples

go 1.22

replace (
github.com/arkavo-org/opentdf-platform/protocol/go => ../protocol/go
github.com/arkavo-org/opentdf-platform/sdk => ../sdk
)

require (
github.com/opentdf/platform/protocol/go v0.1.0
github.com/opentdf/platform/sdk v0.1.0
github.com/arkavo-org/opentdf-platform/protocol/go v0.0.0-00010101000000-000000000000
github.com/arkavo-org/opentdf-platform/sdk v0.0.0-00010101000000-000000000000
github.com/spf13/cobra v1.8.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
Expand All @@ -26,7 +31,6 @@ require (
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.21 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/opentdf/platform/lib/ocrypto v0.1.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
Expand Down
8 changes: 0 additions & 8 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
github.com/opentdf/platform/lib/fixtures v0.1.0 h1:xq0U+8C8tBqRCPGOvlATgeUVtU4qHrNWUdu1HSm3cGU=
github.com/opentdf/platform/lib/fixtures v0.1.0/go.mod h1:+d2iXFUZrI8MrWvh3tA3RK3ZgsnpD3JUtV74RwFJihQ=
github.com/opentdf/platform/lib/ocrypto v0.1.0 h1:y1UlBZirbiFMzM+bVu6y4pjsX4Xhp2M50Tcjkubd/tI=
github.com/opentdf/platform/lib/ocrypto v0.1.0/go.mod h1:eJgEy1WFzdShIwRIzyQ/PotbTpXOq4eApCgchtvSDLg=
github.com/opentdf/platform/protocol/go v0.1.0 h1:eHaBsSanLR4e2kBAPJwlqq02h5kDhSTiZLLPaajKQ38=
github.com/opentdf/platform/protocol/go v0.1.0/go.mod h1:qOBx0d9F2dGeTc703tp+HCGhW6nLYXKZ+vmZ2H9xcPI=
github.com/opentdf/platform/sdk v0.1.0 h1:HrbzLlAwy7Ki5zJ2J4sNNx5jasTXQcV0WnsTpXqNkmU=
github.com/opentdf/platform/sdk v0.1.0/go.mod h1:QiiMXl9JiiZZNfHsXp6IJs/0PlRBEjCfV4nTYYwMoR0=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
Loading

0 comments on commit 127d1cb

Please sign in to comment.