Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: implement PAT for private repos #45

Merged
merged 1 commit into from
Jul 5, 2024
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
24 changes: 21 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:

env:
GO_VERSION: 1.21
READ_PAT: ${{ secrets.ORG_READ_PAT }}

jobs:

Expand All @@ -29,11 +30,17 @@ jobs:
name: tidy
steps:
- uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: |

- name: Configure git to use PAT for reading private repositories
run: git config --global url."https://${{ env.READ_PAT }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"

- name: Go Mod Tidy
run: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
Expand All @@ -48,11 +55,17 @@ jobs:
name: build
steps:
- uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go build ./...

- name: Configure git to use PAT for reading private repositories
run: git config --global url."https://${{ env.READ_PAT }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"

- name: Go Build
run: go build ./...

# Run all standard, go tests
test:
Expand All @@ -63,7 +76,12 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Checkout code
uses: actions/checkout@v4
- name: Test

- name: Configure git to use PAT for reading private repositories
run: git config --global url."https://${{ env.READ_PAT }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"

- name: Go Test
run: go test ./...
13 changes: 10 additions & 3 deletions .github/workflows/interchain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,30 @@ on:
branches: [ main ]
pull_request:

env:
GO_VERSION: 1.21
READ_PAT: ${{ secrets.ORG_READ_PAT }}

jobs:
interchain-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# list names of `make` commands to run e2e tests on
# list names of `make` targets to run e2e tests on
test:
- ictest-cosmos-chain
fail-fast: false
steps:
- name: Set up Go 1.21
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
go-version: ${{ env.GO_VERSION }}

- name: checkout chain
uses: actions/checkout@v4

- name: Configure git to use PAT for reading private repositories
run: git config --global url."https://${{ env.READ_PAT }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"

- name: run test
run: make ${{ matrix.test }}
Loading