diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a287ec1..06073a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: - releases/* - release/* pull_request: - types: [ assigned, opened, synchronize, reopened, labeled ] + types: [ assigned, opened, synchronize, reopened, labeled, edited ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -16,53 +16,26 @@ concurrency: jobs: PR: if: github.event_name == 'pull_request' - uses: formancehq/ci/.github/workflows/go-pr.yml@main + uses: formancehq/ci/.github/workflows/go-pr.yml@v1 permissions: pull-requests: read statuses: write Dirty: - runs-on: namespace-profile-linux-amd64-4vcpu - steps: - - uses: namespacelabs/nscloud-checkout-action@v9 - with: - fetch-depth: 0 - dissociate: true - - - uses: formancehq/ci/actions/setup-nix@main - - - run: nix develop --impure --command just pre-commit - env: - SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} - - - name: Get changed files - shell: bash - run: | - hasChanged=$(git status --porcelain) - if (( $(echo ${#hasChanged}) != 0 )); then - git status - echo "There are changes in the repository" - exit 1 - fi + uses: formancehq/ci/.github/workflows/go-dirty.yml@v1 + secrets: + SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} Tests: - needs: [Dirty] - runs-on: namespace-profile-linux-amd64-4vcpu - steps: - - uses: namespacelabs/nscloud-checkout-action@v9 - with: - fetch-depth: 0 - dissociate: true - - - uses: formancehq/ci/actions/setup-nix@main - - - run: nix develop --impure --command just tests - env: - SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} + uses: formancehq/ci/.github/workflows/go-test.yml@v1 + with: + runner-profile: namespace-profile-linux-amd64-4vcpu + secrets: + SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} GoReleaser: needs: [Dirty] - uses: formancehq/ci/.github/workflows/go-build.yml@main + uses: formancehq/ci/.github/workflows/go-build.yml@v1 with: build-condition: main-and-label build-label: build-images @@ -84,7 +57,7 @@ jobs: - Tests - Dirty steps: - - uses: formancehq/ci/actions/deploy-staging@main + - uses: formancehq/ci/actions/deploy-staging@v1 with: component: auth tag: ${{ github.sha }} diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 94ff5c4..53a384b 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -15,7 +15,7 @@ jobs: fetch-depth: 0 dissociate: true - - uses: formancehq/ci/actions/setup-release@main + - uses: formancehq/ci/actions/setup-release@v1 with: token: ${{ secrets.NUMARY_GITHUB_TOKEN }} diff --git a/Earthfile b/Earthfile deleted file mode 100644 index 4dc7336..0000000 --- a/Earthfile +++ /dev/null @@ -1,51 +0,0 @@ -VERSION 0.8 - -ARG core=github.com/formancehq/earthly:main -IMPORT $core AS core - -FROM core+base-image - -CACHE --sharing=shared --id go-auth-cache /go/pkg/mod -CACHE --sharing=shared --id go-auth-cache /root/.cache/go-build - -sources: - WORKDIR /src - COPY go.* . - COPY --dir cmd pkg . - COPY main.go . - SAVE ARTIFACT /src - -compile: - FROM core+builder-image - COPY (+sources/*) /src - - CACHE --id go-auth-cache /go/pkg/mod - CACHE --id go-auth-cache /root/.cache/go-build - WORKDIR /src - ARG VERSION=latest - DO --pass-args core+GO_COMPILE --VERSION=$VERSION - -build-image: - FROM core+final-image - ENTRYPOINT ["/bin/auth"] - CMD ["serve"] - COPY (+compile/main) /bin/auth - ARG REPOSITORY=ghcr.io - ARG tag=latest - DO core+SAVE_IMAGE --COMPONENT=auth --REPOSITORY=${REPOSITORY} --TAG=$tag - -deploy: - COPY (+sources/*) /src - LET tag=$(tar cf - /src | sha1sum | awk '{print $1}') - WAIT - BUILD --pass-args +build-image --tag=$tag - END - FROM --pass-args core+vcluster-deployer-image - RUN kubectl patch Versions.formance.com default -p "{\"spec\":{\"auth\": \"${tag}\"}}" --type=merge - -deploy-staging: - BUILD --pass-args core+deploy-staging - -openapi: - COPY ./openapi.yaml . - SAVE ARTIFACT ./openapi.yaml