Skip to content

Bump actions/checkout from 3.5.3 to 4.0.0 #124

Bump actions/checkout from 3.5.3 to 4.0.0

Bump actions/checkout from 3.5.3 to 4.0.0 #124

Workflow file for this run

name: lint-and-test
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
token: ${{ secrets.TFLIBSONNET_CI_GITHUB_TOKEN }}
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: 1.19
- name: install and run docsonnet
run: |
go install github.com/jsonnet-libs/docsonnet@latest
docsonnet main.libsonnet
- name: import gpg signing key
uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.0
with:
gpg_private_key: ${{ secrets.TFLIBSONNET_CI_GPG_KEY }}
passphrase: ${{ secrets.TFLIBSONNET_CI_GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: "tflibsonnet-ci"
git_committer_email: "120686569+tflibsonnet-ci@users.noreply.github.com"
- name: commit docs if files changed
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0
with:
commit_message: "Update docs"
file_pattern: "docs"
commit_options: "-S -s"
commit_user_name: "tflibsonnet-ci"
commit_user_email: "120686569+tflibsonnet-ci@users.noreply.github.com"
- name: halt pipeline if new commit was created
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: "false"
lint:
needs: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: 1.19
- name: install jsonnet-bundler, jsonnetfmt, and jsonnet-lint
run: |
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
go install github.com/google/go-jsonnet/cmd/jsonnetfmt@v0.20.0
go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.20.0
- name: check for fmt
run: |
find . -name "*.jsonnet" -or -name "*.libsonnet" | xargs -L1 jsonnetfmt --test
- name: install dependencies
run: |
jb install
- name: check for lint
run: |
export JSONNET_PATH="$(pwd)/vendor:$(pwd)"
find . -not -path "./vendor/*" \( -name "*.jsonnet" -or -name "*.libsonnet" \) \
| xargs -L1 -t jsonnet-lint
golangci:
needs: docs
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: 1.19
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: golangci-lint
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
with:
version: v1.50.1
args: "--timeout=10m"
working-directory: "test"
test:
needs: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: 1.3.6
terraform_wrapper: false
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: 1.19
cache: true
cache-dependency-path: test/go.sum
- name: run tests
run: |
cd test
go test -v .