From b17b23665b58ddbeba21fa59f1a14bbaa11fff02 Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Mon, 8 Apr 2024 02:05:45 +0000 Subject: [PATCH] ci: fix CI and standardize things --- .github/workflows/CI.yml | 56 ++++-------------------- .github/workflows/CompatHelper.yml | 14 ++++-- .github/workflows/DocsPreviewCleanup.yml | 2 +- .github/workflows/Documentation.yml | 28 ++++++++++++ .github/workflows/Downgrade.yml | 16 ++++--- 5 files changed, 58 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/Documentation.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 40a5bf5..e876dae 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,72 +3,34 @@ on: push: branches: - main - tags: ['*'] + paths-ignore: + - 'docs/**' pull_request: - 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/') }} + paths-ignore: + - 'docs/**' jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} - timeout-minutes: 60 - permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created - actions: write - contents: read strategy: fail-fast: false matrix: version: - - '1.10' - - 'nightly' + - '1' os: - ubuntu-latest - arch: - - x64 steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - uses: julia-actions/cache@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 + with: + depwarn: error - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v3 with: files: lcov.info - 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@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: '1' - - uses: julia-actions/cache@v1 - - 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 }} - - name: Run doctests - shell: julia --project=docs --color=yes {0} - run: | - using Documenter: DocMeta, doctest - using UDEComponents - DocMeta.setdocmeta!(UDEComponents, :DocTestSetup, :(using UDEComponents); recursive=true) - doctest(UDEComponents) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index cba9134..d7a8b34 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,16 +1,24 @@ name: CompatHelper + on: schedule: - - cron: 0 0 * * * + - cron: '00 00 * * *' workflow_dispatch: + +permissions: + contents: write + pull-requests: write + jobs: CompatHelper: runs-on: ubuntu-latest steps: + - uses: julia-actions/setup-julia@v2 + with: + version: 1.3 - 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()' + run: julia -e 'using CompatHelper; CompatHelper.main(;subdirs=["", "docs"])' diff --git a/.github/workflows/DocsPreviewCleanup.yml b/.github/workflows/DocsPreviewCleanup.yml index d16167f..b6ef7f7 100644 --- a/.github/workflows/DocsPreviewCleanup.yml +++ b/.github/workflows/DocsPreviewCleanup.yml @@ -1,5 +1,5 @@ name: - +gs on: pull_request: types: [closed] diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 0000000..a54b63b --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,28 @@ +name: Documentation +on: + push: + branches: + - main + tags: '*' + pull_request: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: '1' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key + run: julia --project=docs/ docs/make.jl + - uses: julia-actions/julia-processcoverage@v1 + with: + directories: src + - uses: codecov/codecov-action@v3 + with: + files: lcov.info diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index ccfa12a..c6dbfde 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -1,8 +1,6 @@ name: Downgrade on: pull_request: - branches: - - main paths-ignore: - 'docs/**' push: @@ -12,20 +10,24 @@ on: - 'docs/**' jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - version: ['1'] - group: - - Core + version: + - '1' + os: + - ubuntu-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} - uses: julia-actions/julia-downgrade-compat@v1 -# if: ${{ matrix.version == '1.6' }} with: skip: Pkg,TOML + - uses: julia-actions/cache@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1