diff --git a/.github/workflows/scheduled-jobs.yaml b/.github/workflows/scheduled-jobs.yaml index 62181398c..c235a2d94 100644 --- a/.github/workflows/scheduled-jobs.yaml +++ b/.github/workflows/scheduled-jobs.yaml @@ -28,12 +28,24 @@ jobs: if: github.repository == 'CustomResourceDefinition/catalog' || github.event_name == 'workflow_dispatch' permissions: contents: write - packages: write steps: - uses: actions/checkout@v6 with: ssh-key: ${{ secrets.DEPLOY_KEY_SCHEDULED_JOBS }} + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - uses: actions/cache@v5 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Optionally remove paths if: github.event_name == 'workflow_dispatch' && github.event.inputs.reset != '' run: | @@ -46,10 +58,6 @@ jobs: cd - - run: make update - env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REF: ${{ github.ref }} - uses: actions/checkout@v6 with: @@ -57,10 +65,6 @@ jobs: path: build/remote/datreeio - run: make comparison - env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REF: ${{ github.ref }} - uses: EndBug/add-and-commit@v9 name: Publish changes @@ -78,7 +82,7 @@ jobs: needs: - update-schemas - sync-tags - if: failure() && github.event_name != 'workflow_dispatch' + if: failure() && github.repository == 'CustomResourceDefinition/catalog' && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' permissions: contents: read issues: write @@ -97,6 +101,7 @@ jobs: name: Synchronize tags with kubernetes runs-on: ubuntu-latest needs: update-schemas + if: github.repository == 'CustomResourceDefinition/catalog' && github.ref == 'refs/heads/main' permissions: contents: write steps: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a97d08435..425881a18 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,8 +12,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - uses: actions/cache@v5 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - run: make test - env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REF: ${{ github.ref }} diff --git a/make.d/help.txt b/make.d/help.txt index f0fca66d8..05eb717ef 100644 --- a/make.d/help.txt +++ b/make.d/help.txt @@ -9,7 +9,7 @@ Available targets: clean Removes temporarily generated files and builds and removes local container images comparison Updates COMPARISON.md based on the /schema contents help Displays this help - schema-check Verifies all schema files against jsonschema schema file - this takes a very long time + schema-check Verifies all schema files against jsonschema schema file - this takes a very long time tags Synchronize semantic version tags from kubernetes into this repository test Runs the entire test suite update Updates the /schema contents