From 676e3c75a5318eb10b6bddf364d710c8ad512a41 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Thu, 3 Apr 2025 22:50:15 +0200 Subject: [PATCH 01/12] Use jas --- .github/workflows/check.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 76e3ff1..1fe9efc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -58,9 +58,20 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: crate-ci/typos@master - with: - files: '.' + - name: Install jas + run: | + cargo install --debug jas@0.1.0 + echo "$HOME/.jas/bin" >> $GITHUB_PATH + + - name: Install Typos + run: | + jas install \ + --gh crate-ci/typos@v1.31.1 \ + --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - run: typos . fmt: runs-on: ubuntu-latest From 5e9dbcdc1ddf5de0eab3a5f903901e234a160697 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Thu, 3 Apr 2025 22:52:57 +0200 Subject: [PATCH 02/12] Without github token --- .github/workflows/check.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1fe9efc..9766a8c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -68,8 +68,6 @@ jobs: jas install \ --gh crate-ci/typos@v1.31.1 \ --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: typos . From fcc4389e9dcf2f18072289b82bf86e626cbe3c95 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 17:26:22 +0200 Subject: [PATCH 03/12] Update --- .github/workflows/check.yml | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9766a8c..9239487 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,10 +14,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: rustup update stable - run: rustup default stable - - uses: actions/cache@v4 with: path: | @@ -27,26 +25,22 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }} - - uses: actions/cache@v4 with: path: ~/.cache/typst key: typst - + - run: cargo install --debug --git https://github.com/rikhuijzer/jas + - run: > + jas install + --gh typst/typst@v0.13.1 + --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f - run: sudo apt-get install -y ffmpeg - - - run: cargo install cargo-binstall - - - run: cargo binstall typst-cli - - run: | echo "DEEPINFRA_KEY=${{ secrets.DEEPINFRA_KEY }}" > keys.env echo "ELEVENLABS_KEY=${{ secrets.ELEVENLABS_KEY }}" >> keys.env echo "GOOGLE_KEY=${{ secrets.GOOGLE_KEY }}" >> keys.env echo "OPENAI_KEY=${{ secrets.OPENAI_KEY }}" >> keys.env - - run: cargo test --all-features - - name: Cleanup before Post Run run: rm keys.env @@ -54,28 +48,19 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' timeout-minutes: 10 - steps: - uses: actions/checkout@v4 - - - name: Install jas - run: | - cargo install --debug jas@0.1.0 - echo "$HOME/.jas/bin" >> $GITHUB_PATH - - - name: Install Typos - run: | - jas install \ - --gh crate-ci/typos@v1.31.1 \ - --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 - + - run: cargo install --debug --git https://github.com/rikhuijzer/jas + - run: > + jas install + --gh crate-ci/typos@v1.31.1 \ + --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 - run: typos . fmt: runs-on: ubuntu-latest if: github.event_name == 'pull_request' timeout-minutes: 10 - steps: - uses: actions/checkout@v4 - run: rustup update stable @@ -87,7 +72,6 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' timeout-minutes: 10 - steps: - uses: actions/checkout@v4 - run: rustup update stable From b526c88db2e642ca683e0c195ff0d2d6ed3d473f Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 17:28:20 +0200 Subject: [PATCH 04/12] Fix typo --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9239487..d2b416b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -53,7 +53,7 @@ jobs: - run: cargo install --debug --git https://github.com/rikhuijzer/jas - run: > jas install - --gh crate-ci/typos@v1.31.1 \ + --gh crate-ci/typos@v1.31.1 --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 - run: typos . From c921a7b8c8d777e2cd65537f11f6ddb778980ee6 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 18:03:19 +0200 Subject: [PATCH 05/12] Add audit --- .github/workflows/audit.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/audit.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..98f3157 --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,41 @@ +name: audit + +on: + schedule: + - cron: '34 3 * * *' + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + cargo-audit: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - run: cargo install --debug --path . + - run: > + jas install + --gh rustsec/rustsec@cargo-audit/v0.21.2 + --archive-filename cargo-audit + --sha 5eaad156124e01d54ce937cbb2c069a8145b01e7fa29aef62bef1b386b4c1519 + - run: cargo-audit audit + + cargo-deny: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - run: cargo install --debug --path . + - run: > + jas install + --gh EmbarkStudios/cargo-deny@0.18.2 + --sha 43c4a79c4b9fd1fcb3dddb305a1b4d8f7ac4a72accd61bb50a0b698789ca894c + # Using GITHUB_TOKEN because the tests make lots of requests and may hit rate limits. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: cargo-deny check advisories \ No newline at end of file From 86de250d1bd1f34c148837be3abb657fa73bc0dc Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 18:04:43 +0200 Subject: [PATCH 06/12] Update --- .github/workflows/examples.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 318ee4d..13fa011 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -18,10 +18,8 @@ jobs: # Not using non-official GitHub Actions for security reasons. steps: - uses: actions/checkout@v4 - - run: rustup update stable - run: rustup default stable - - uses: actions/cache@v4 with: path: | @@ -31,25 +29,20 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-examples-${{ hashFiles('**/Cargo.lock') }} - - run: sudo apt-get install -y ffmpeg - - - run: cargo install cargo-binstall - - - run: cargo binstall typst-cli - + - run: cargo install --debug --git https://github.com/rikhuijzer/jas + - run: > + jas install + --gh typst/typst@v0.13.1 + --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f - run: sudo apt-get install -y imagemagick - - - run: cargo install --path . - + - run: cargo install --debug --path . - run: | echo "DEEPINFRA_KEY=${{ secrets.DEEPINFRA_KEY }}" > keys.env echo "GOOGLE_KEY=${{ secrets.GOOGLE_KEY }}" >> keys.env - - run: | mkdir _public echo "

Home page for the examples

" > _public/index.html - - name: Run examples run: | convert -size 500x500 xc:none -fill white -draw "polygon 150,100 150,400 400,250" play_button.png @@ -73,10 +66,8 @@ jobs: mv _out/out.mp4 _public/zonos.mp4 convert _out/image/1.png play_button.png -gravity center -composite tmp.png mv tmp.png _public/zonos.png - - name: Cleanup run: rm keys.env - - name: Upload static files id: deployment uses: actions/upload-pages-artifact@v3 @@ -94,7 +85,6 @@ jobs: permissions: pages: write id-token: write - steps: - uses: actions/deploy-pages@v4 id: deployment From a940af461f6402f7a3236030f592bc788d295e09 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 18:08:16 +0200 Subject: [PATCH 07/12] Update --- .github/workflows/audit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 98f3157..a7ccb1e 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -16,7 +16,7 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 - - run: cargo install --debug --path . + - run: cargo install --debug --git https://github.com/rikhuijzer/jas - run: > jas install --gh rustsec/rustsec@cargo-audit/v0.21.2 @@ -30,7 +30,7 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 - - run: cargo install --debug --path . + - run: cargo install --debug --git https://github.com/rikhuijzer/jas - run: > jas install --gh EmbarkStudios/cargo-deny@0.18.2 From 1862ba811f718b3fc711919c1f90f897230bf483 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 19:04:54 +0200 Subject: [PATCH 08/12] Update --- .github/workflows/check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d2b416b..23d80e6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -55,6 +55,9 @@ jobs: jas install --gh crate-ci/typos@v1.31.1 --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 + # To reduce the chance of rate limiting. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: typos . fmt: From 4a430a28225371898b686b74cc9fc3e6f45365ad Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 19:55:53 +0200 Subject: [PATCH 09/12] Update --- .github/workflows/examples.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 13fa011..ec1f90d 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -30,16 +30,16 @@ jobs: target/ key: ${{ runner.os }}-cargo-examples-${{ hashFiles('**/Cargo.lock') }} - run: sudo apt-get install -y ffmpeg - - run: cargo install --debug --git https://github.com/rikhuijzer/jas - - run: > - jas install - --gh typst/typst@v0.13.1 - --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f - run: sudo apt-get install -y imagemagick - run: cargo install --debug --path . - run: | echo "DEEPINFRA_KEY=${{ secrets.DEEPINFRA_KEY }}" > keys.env echo "GOOGLE_KEY=${{ secrets.GOOGLE_KEY }}" >> keys.env + - run: cargo install --debug --git https://github.com/rikhuijzer/jas + - run: > + jas install + --gh typst/typst@v0.13.1 + --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f - run: | mkdir _public echo "

Home page for the examples

" > _public/index.html From de0dc82ffa821f664f291c26965061d3187af85b Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 19:59:12 +0200 Subject: [PATCH 10/12] Do not cache bin --- .github/workflows/examples.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index ec1f90d..ca16c7f 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -23,7 +23,6 @@ jobs: - uses: actions/cache@v4 with: path: | - ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ From f85019364fc2c5c45cafbbf6f7285643cee6b3fe Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 20:00:06 +0200 Subject: [PATCH 11/12] Update --- .github/workflows/examples.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index ca16c7f..be448b6 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -35,6 +35,13 @@ jobs: echo "DEEPINFRA_KEY=${{ secrets.DEEPINFRA_KEY }}" > keys.env echo "GOOGLE_KEY=${{ secrets.GOOGLE_KEY }}" >> keys.env - run: cargo install --debug --git https://github.com/rikhuijzer/jas + - run: | + TOKEN="$GITHUB_TOKEN" + if [ -z "$TOKEN" ]; then + echo "Token is not set." + else + echo "Token is set." + fi - run: > jas install --gh typst/typst@v0.13.1 From 6a32aff928b0ae0b4cde1bd50e4d0447ead5ab61 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Fri, 4 Apr 2025 20:10:45 +0200 Subject: [PATCH 12/12] Update --- .github/workflows/check.yml | 17 ++++++++--------- .github/workflows/examples.yml | 14 ++++---------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 23d80e6..2e5067f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -30,10 +30,11 @@ jobs: path: ~/.cache/typst key: typst - run: cargo install --debug --git https://github.com/rikhuijzer/jas - - run: > - jas install - --gh typst/typst@v0.13.1 - --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f + - run: | + jas install --gh typst/typst@v0.13.1 \ + --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: sudo apt-get install -y ffmpeg - run: | echo "DEEPINFRA_KEY=${{ secrets.DEEPINFRA_KEY }}" > keys.env @@ -51,11 +52,9 @@ jobs: steps: - uses: actions/checkout@v4 - run: cargo install --debug --git https://github.com/rikhuijzer/jas - - run: > - jas install - --gh crate-ci/typos@v1.31.1 - --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 - # To reduce the chance of rate limiting. + - run: | + jas install --gh crate-ci/typos@v1.31.1 \ + --sha f683c2abeaff70379df7176110100e18150ecd17a4b9785c32908aca11929993 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: typos . diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index be448b6..48f572b 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -36,16 +36,10 @@ jobs: echo "GOOGLE_KEY=${{ secrets.GOOGLE_KEY }}" >> keys.env - run: cargo install --debug --git https://github.com/rikhuijzer/jas - run: | - TOKEN="$GITHUB_TOKEN" - if [ -z "$TOKEN" ]; then - echo "Token is not set." - else - echo "Token is set." - fi - - run: > - jas install - --gh typst/typst@v0.13.1 - --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f + jas install --gh typst/typst@v0.13.1 \ + --sha 7d214bfeffc2e585dc422d1a09d2b144969421281e8c7f5d784b65fc69b5673f + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | mkdir _public echo "

Home page for the examples

" > _public/index.html