Skip to content

Commit

Permalink
chore(ci): update GitHub Workflows and Actions (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims authored Apr 2, 2024
2 parents a175fb2 + 2b696f6 commit fe3c7a9
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 60 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
path: clients/fga-js-sdk

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0

- name: Run SDK Tests
run: make test-client-js
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
path: clients/fga-go-sdk

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0

- name: Run SDK Tests
run: make test-client-go
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
path: clients/fga-dotnet-sdk

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0

- name: Run All Tests
run: make test-client-dotnet
Expand All @@ -105,7 +105,6 @@ jobs:
git status
git diff
build-and-test-python-sdk:
runs-on: ubuntu-latest
steps:
Expand All @@ -114,9 +113,9 @@ jobs:
fetch-depth: 0

- name: Specify python version
uses: actions/setup-python@v5
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.10'
python-version: "3.10"

- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
Expand All @@ -125,7 +124,7 @@ jobs:
path: clients/fga-python-sdk

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0

- name: Run All Tests
run: |-
Expand Down Expand Up @@ -153,8 +152,8 @@ jobs:
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 11
distribution: 'temurin'
cache: 'gradle'
distribution: "temurin"
cache: "gradle"

- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
Expand All @@ -163,7 +162,7 @@ jobs:
path: clients/fga-java-sdk

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0

- name: Run All Tests
run: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

Expand All @@ -30,7 +30,7 @@ jobs:
- name: Test
run: dotnet test --no-build --verbosity normal

- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.1
with:
name: nuget-package
path: src/<%packageName%>/bin/Release/<%packageName%>.*.nupkg
Expand All @@ -41,7 +41,7 @@ jobs:
needs: [test]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

Expand All @@ -59,7 +59,7 @@ jobs:
- name: Build
run: dotnet build --no-restore --configuration Release

- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.1
with:
name: nuget-package
path: src/<%packageName%>/bin/Release/<%packageName%>.*.nupkg
Expand All @@ -75,11 +75,11 @@ jobs:
needs: publish

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
Expand Down
36 changes: 18 additions & 18 deletions config/clients/go/template/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,39 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.5.4
with:
fetch-depth: 0
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
cache-dependency-path: './go.sum'
check-latest: true
go-version: '>=1.21.1'
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
cache-dependency-path: "./go.sum"
check-latest: true
go-version: ">=1.21.1"

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

- name: Test
run: go test -v ./...
- name: Test
run: go test -v ./...

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Run govulncheck
run: govulncheck ./...
- name: Run govulncheck
run: govulncheck ./...

create-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [test]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.5.4
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
Expand Down
21 changes: 10 additions & 11 deletions config/clients/java/template/.github/workflows/main.yml.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
matrix:
java: [ '11', '17', '21' ]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Set up JDK
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
{{=< >=}}
java-version: ${{ matrix.java }}
Expand All @@ -27,7 +27,6 @@ jobs:
- name: Test and Build with Gradle
run: |
./gradlew build test-integration


publish-maven-central:
runs-on: ubuntu-latest
Expand All @@ -38,16 +37,16 @@ jobs:
needs: [test]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Set up JDK
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 11
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- name: Publish package
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3.1.0
Expand All @@ -69,16 +68,16 @@ jobs:
needs: [test]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Set up JDK
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 11
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- name: Publish package
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3.1.0
Expand All @@ -96,9 +95,9 @@ jobs:
needs: [publish-maven-central, publish-github-packages]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
Expand Down
18 changes: 9 additions & 9 deletions config/clients/js/template/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
scope: '@openfga'
registry-url: "https://registry.npmjs.org"
scope: "@openfga"
always-auth: false
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -48,8 +48,8 @@ jobs:
- name: Set up node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -79,11 +79,11 @@ jobs:
- name: Set up node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
scope: '@openfga'
node-version: "20"
registry-url: "https://registry.npmjs.org"
scope: "@openfga"
always-auth: false
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm ci
Expand Down
12 changes: 6 additions & 6 deletions config/clients/python/template/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -44,12 +44,12 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.10"
cache: "pip"
Expand All @@ -66,15 +66,15 @@ jobs:
python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14

create-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [publish]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0

Expand Down

0 comments on commit fe3c7a9

Please sign in to comment.