From ca53cc4e095ea4536a0f97a950c63e031d178ee3 Mon Sep 17 00:00:00 2001 From: chengchingwen Date: Sun, 9 Jun 2024 23:33:35 +0800 Subject: [PATCH] update ci --- .github/dependabot.yml | 7 +++ .github/workflows/CompatHelper.yml | 20 ++------ .github/workflows/TagBot.yml | 21 ++++++++- .github/workflows/ci-pretrain.yml | 23 ---------- .github/workflows/ci.yml | 73 ++++++++++++++++++------------ 5 files changed, 74 insertions(+), 70 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/ci-pretrain.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..700707ce --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 38c83820..cba9134c 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,26 +1,16 @@ name: CompatHelper - on: schedule: - - cron: '00 * * * *' - issues: - types: [opened, reopened] - + - cron: 0 0 * * * + workflow_dispatch: jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.5.1] - julia-arch: [x86] - os: [ubuntu-latest] + CompatHelper: + runs-on: ubuntu-latest steps: - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.julia-version }} - name: Pkg.add("CompatHelper") run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - name: CompatHelper.main() env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index 13a88ead..0cd3114e 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,9 +1,25 @@ name: TagBot on: - issue_comment: + issue_comment: types: - created - workflow_dispatch: + workflow_dispatch: + inputs: + lookback: + default: "3" +permissions: + actions: read + checks: read + contents: write + deployments: read + issues: read + discussions: read + packages: read + pages: read + pull-requests: read + repository-projects: read + security-events: read + statuses: read jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' @@ -12,3 +28,4 @@ jobs: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.github/workflows/ci-pretrain.yml b/.github/workflows/ci-pretrain.yml deleted file mode 100644 index 9c988f0f..00000000 --- a/.github/workflows/ci-pretrain.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: CI-Pretrain - -on: - workflow_dispatch: - -defaults: - run: - shell: bash - -jobs: - pretrain: - name: Pretrain - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: '1' - - run: TEST_TRANSFORMERS_PRETRAIN=yes julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test(; coverage=true)'; - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 - with: - file: lcov.info diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09262a68..24878015 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,23 @@ name: CI - on: push: branches: - master tags: '*' pull_request: - -defaults: - run: - shell: bash - + workflow_dispatch: +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.julia-threads }} thread(s) - ${{ github.event_name }} + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.julia-threads }} thread(s) - ${{ github.event_name }} runs-on: ${{ matrix.os }} + permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created + actions: write + contents: read env: JULIA_NUM_THREADS: ${{ matrix.julia-threads }} JL_TRF_TEST_TKR: ${{ matrix.test-hgf-tkr }} @@ -24,6 +27,7 @@ jobs: matrix: version: - '1.10' # Replace this with the minimum Julia version that your package supports. + - '1.11' # - '1' # automatically expands to the latest stable 1.x release of Julia # - 'nightly' os: @@ -49,38 +53,47 @@ jobs: julia-threads: '2' test-hgf-tkr: 'true' steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/install-juliaup@v2 with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - run: julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test(; coverage=true)'; + channel: ${{ matrix.version }} + - uses: julia-actions/cache@v2 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v4 with: - file: lcov.info - + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false docs: name: Documentation runs-on: ubuntu-latest + permissions: + actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created + contents: write + statuses: write steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: '1' - - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); - Pkg.instantiate()' - - run: julia --project=docs docs/make.jl + - uses: julia-actions/cache@v2 + - name: Configure doc environment + shell: julia --project=docs --color=yes {0} + run: | + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate() + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + - name: Run doctests + shell: julia --project=docs --color=yes {0} + run: | + using Documenter: DocMeta, doctest + using Transformers + DocMeta.setdocmeta!(Transformers, :DocTestSetup, :(using Transformers); recursive=true) + doctest(Transformers)