diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml new file mode 100644 index 0000000..f736669 --- /dev/null +++ b/.forgejo/workflows/check.yml @@ -0,0 +1,23 @@ +on: + push: +jobs: + check: + runs-on: nixos + steps: + - uses: "https://code.forgejo.org/actions/checkout@v4" + - run: nix --version + - run: nix flake check --keep-going --verbose + build: + runs-on: nixos + strategy: + matrix: + target: + - audiomenu + - docs + - jpassmenu + - nixosConfigurations.vm.config.system.build.toplevel + - nvim + steps: + - uses: "https://code.forgejo.org/actions/checkout@v4" + - run: nix --version + - run: nix build --print-build-logs '.#${{ matrix.target }}' diff --git a/ci-scripts/report-size.sh b/ci-scripts/report-size.sh index 77533d7..c573541 100755 --- a/ci-scripts/report-size.sh +++ b/ci-scripts/report-size.sh @@ -18,23 +18,21 @@ package_size_table() { } if [ "$CI" = "true" ]; then - pr_number=$(curl -X 'GET' \ - "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \ - -H 'accept: application/json' | - jq --arg head_ref "$GITHUB_HEAD_REF" '.[] | select(.head.ref == $head_ref) | .number') - echo "Retrieved index: $pr_number" - echo "Expected PR URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pulls/$pr_number" - echo "Logging in to $GITHUB_SERVER_URL with default token" tea login add --url "$GITHUB_SERVER_URL" --token "$GITHUB_TOKEN" - tea comment "$pr_number" "$( + echo "Retrieving PR index for $GITHUB_HEAD_REF" + tea pulls -f index,head -o simple + pr_index=$(tea pulls -f index,head -o simple | grep "$GITHUB_HEAD_REF" | head -n1 | cut -d' ' -f 1) + echo "Retrieved index: $pr_index" + echo "Expected PR URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pulls/$pr_index" + tea comment "$pr_index" "$( cat <<-EOF ### NixOS Configurations sizes - + TODO - + ### Package sizes - + $(package_size_table) EOF )"