Skip to content

Commit

Permalink
test: Fix the tests running in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Oct 27, 2023
1 parent e5e2328 commit 4546390
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 34 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,17 @@ permissions:
contents: read

jobs:
examples:
runs-on: ubuntu-latest
name: Examples
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit

- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: '>= 1.21'
cache: true

- name: Run example tests
run: |
make examples
unit:
runs-on: ubuntu-latest
name: Unit
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
disable-sudo: true
egress-policy: block #audit
allowed-endpoints: >
github.com:443
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -62,7 +41,7 @@ jobs:

- name: Run unit tests
run: |
make unit
go test -count=1 -parallel=$(nproc) -timeout 30s -v ./corefunc/...
acc:
runs-on: ubuntu-latest
Expand All @@ -83,7 +62,11 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
disable-sudo: true
egress-policy: block # audit
allowed-endpoints: >
github.com:443
releases.hashicorp.com:443
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -104,4 +87,4 @@ jobs:

- name: Run acceptance tests
run: |
make acc
TF_ACC=1 go test -run=TestAcc -count=1 -parallel=$(nproc) -timeout 30m -v ./corefuncprovider/...
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ repos:
language: system
stages: [commit, push]

- id: actionlint
name: Actionlint
description: Lint GitHub Actions workflows
entry: bash -c 'actionlint'
language: system
stages: [commit, push]
# - id: actionlint
# name: Actionlint
# description: Lint GitHub Actions workflows
# entry: bash -c 'actionlint'
# language: system
# stages: [commit, push]

- id: unconvert
name: 'Go: unconvert (current GOOS/GOARCH)'
Expand Down

0 comments on commit 4546390

Please sign in to comment.