Skip to content

Commit

Permalink
ci: remove unused tools and packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Aug 27, 2024
1 parent 12ee65c commit 23aaafa
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 196 deletions.
6 changes: 2 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[alias]
# bins
insta = ["bin", "cargo-insta"]
llvm-cov = ["bin", "cargo-llvm-cov"]
nextest = ["bin", "cargo-nextest"]
insta = ["bin", "cargo-insta"]
leptos = ["bin", "cargo-leptos"]
mutants = ["bin", "cargo-mutants"]

#testing
# testing
test_codegen = ["nextest", "run", "--features", "serde,query"]
test_docs = ["test", "--doc", "--features", "serde,query"]
coverage_codegen = ["llvm-cov", "--no-report", "--features", "serde,query"]
Expand Down
12 changes: 1 addition & 11 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dir = "target/nextest"
# This section defines the default nextest profile. Custom profiles are layered
# on top of the default profile.
[profile.default]

# "retries" defines the number of times a test should be retried. If set to a
# non-zero value, tests that succeed on a subsequent attempt will be marked as
# flaky. Can be overridden through the `--retries` option.
Expand Down Expand Up @@ -95,16 +94,7 @@ leak-timeout = "100ms"
# `nextest archive` automatically includes any build output required by a standard build.
# However sometimes extra non-standard files are required.
# To address this, "archive.include" specifies additional paths that will be included in the archive.
archive.include = [
# Examples:
#
# { path = "application-data", relative-to = "target" },
# { path = "data-from-some-dependency/file.txt", relative-to = "target" },
#
# In the above example:
# * the directory and its contents at "target/application-data" will be included recursively in the archive.
# * the file "target/data-from-some-dependency/file.txt" will be included in the archive.
]
archive.include = []

[profile.default.junit]
# Output a JUnit report into the given file inside 'store.dir/<profile-name>'.
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/devenv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ inputs:
github-token:
description: Provide a github token
required: true

nix-cache:
description: The location of the nix cache
required: true

runs:
using: composite
steps:
Expand All @@ -17,51 +19,63 @@ runs:
path: ${{ inputs.nix-cache }}
key: ${{ runner.os }}-nix-cache-${{ hashFiles('**/devenv.nix', '**/devenv.yaml', '**/devenv.lock') }}
restore-keys: ${{ runner.os }}-nix-cache-

- name: install nix
uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ inputs.github-token }}

- name: import nix store cache
if: steps.nix-cache.outputs.cache-hit == 'true'
run: nix-store --import < ${{ inputs.nix-cache }}
shell: bash

- name: enable cachix
uses: cachix/cachix-action@v15
with:
name: devenv

- name: install devenv.sh
run: |
cachix use devenv
nix profile install --accept-flake-config github:cachix/devenv/v1.0.8
shell: bash

- name: build developer environment
run: devenv test
shell: bash

- name: update path with devenv
run: devenv shell setup:ci
shell: bash

- name: export nix store cache
if: steps.nix-cache.outputs.cache-hit != 'true'
run: nix-store --export $(find /nix/store -maxdepth 1 -name '*-*')> ${{ inputs.nix-cache }}
shell: bash

- name: cache rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}

- name: cache cargo binaries
uses: actions/cache@v4
with:
path: ./.bin
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('rust-toolchain.toml') }}-${{ env.RUSTUP_TOOLCHAIN }}
restore-keys: |
${{ runner.os }}-cargo-bin-
- name: get pnpm store directory
id: pnpm-cache
run: echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
shell: bash

- name: install dependencies
run: install:all
shell: bash

- name: setup database
run: db:setup
shell: bash
22 changes: 21 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,33 @@ on:
pull_request:
branches:
- main

env:
EDGEDB_INSTANCE: "edgedb_codegen"
EDGEDB_BRANCH: "main"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
lint:
timeout-minutes: 15
runs-on: "ubuntu-latest"
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup
uses: ./.github/actions/devenv
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache: /tmp/nixcache

- name: lint
run: lint:all
shell: bash

test:
timeout-minutes: 15
runs-on: "ubuntu-latest"
Expand All @@ -41,34 +47,41 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup
uses: ./.github/actions/devenv
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache: /tmp/nixcache

- name: test
run: test:all
shell: bash

coverage:
timeout-minutes: 15
runs-on: "ubuntu-latest"
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup
uses: ./.github/actions/devenv
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache: /tmp/nixcache

- name: test coverage
run: coverage:all
shell: bash

- name: upload coverage
uses: codecov/codecov-action@v3
with:
files: codecov.json
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

build:
timeout-minutes: 15
runs-on: "ubuntu-latest"
Expand All @@ -80,14 +93,17 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup
uses: ./.github/actions/devenv
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
nix-cache: /tmp/nixcache

- name: build
run: cargo build
shell: bash

release:
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand All @@ -99,20 +115,24 @@ jobs:
with:
app-id: ${{ secrets.APP_ID }} # <-- GitHub App ID secret name
private-key: ${{ secrets.APP_PRIVATE_KEY }} # <-- GitHub App private key secret name

- name: setup rust
uses: dtolnay/rust-toolchain@stable

- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}

- name: release
uses: MarcoIeni/[email protected]
id: release-plz
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Tag released PRs

- name: tag released prs
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
RELEASES: ${{ steps.release-plz.outputs.releases }}
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ edgedb_codegen_macros = { path = "./crates/edgedb_codegen_macros", version = "0.
[workspace.metadata.bin]
cargo-insta = { version = "1.39.0" }
cargo-llvm-cov = { version = "0.6.10" }
cargo-mutants = { version = "24.7.0" }
cargo-nextest = { version = "0.9.72" }

[workspace.lints.rust]
Expand Down
25 changes: 2 additions & 23 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
packages = [
pkgs.cargo-binstall
pkgs.cargo-run-bin
pkgs.coreutils
pkgs.dprint
pkgs.edgedb
pkgs.nil
pkgs.nixpkgs-fmt
pkgs.nixfmt
pkgs.rustup
pkgs.shfmt
pkgs.taplo
pkgs.yamlfmt
] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
pkgs.libiconv
pkgs.coreutils
frameworks.Security
frameworks.System
]);
Expand Down Expand Up @@ -117,22 +114,4 @@
echo "DEVENV_ROOT=$DEVENV_ROOT" >> $GITHUB_ENV
echo "DEVENV_STATE=$DEVENV_STATE" >> $GITHUB_ENV
'';
scripts."setup:docker".exec = ''
set -e
# update path
echo "export PATH=$DEVENV_PROFILE/bin:\$PATH" >> /etc/profile
echo "export DEVENV_PROFILE=$DEVENV_PROFILE" >> /etc/profile
echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> /etc/profile
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> /etc/profile
echo "export LIBRARY_PATH=$LIBRARY_PATH" >> /etc/profile
echo "export C_INCLUDE_PATH=$C_INCLUDE_PATH" >> /etc/profile
echo "export XDG_DATA_DIRS=$XDG_DATA_DIRS" >> /etc/profile
echo "export XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS" >> /etc/profile
echo "export DEVENV_DOTFILE=$DEVENV_DOTFILE" >> /etc/profile
echo "export DEVENV_PROFILE=$DEVENV_PROFILE" >> /etc/profile
echo "export DEVENV_ROOT=$DEVENV_ROOT" >> /etc/profile
echo "export DEVENV_STATE=$DEVENV_STATE" >> /etc/profile
'';
}
33 changes: 15 additions & 18 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
{
"useTabs": true,
"indentWidth": 2,
"lineWidth": 100,
"exec": {
"commands": [
{
"command": "rustfmt --unstable-features --edition 2021",
"exts": ["rs"]
},
{
"command": "shfmt --filename {{file_path}} -i 0",
"exts": [
"sh",
"bash"
]
},
{
"command": "yamlfmt -in -formatter indent={{indent_width}},max_line_length={{line_width}}",
"exts": [
"yml",
"yaml"
]
"command": "nixfmt",
"exts": ["nix"]
},
{
"command": "taplo fmt --stdin-filepath={{file_path}} -",
"exts": [
"toml"
]
"command": "shfmt --filename {{file_path}} -i 0",
"exts": ["sh", "bash"]
}
]
},
Expand All @@ -34,12 +23,18 @@
"deno": true,
"useTabs": true
},
"yaml": {},
"toml": {
"useTabs": true,
"indentWidth": 2,
"cargo.applyConventions": true
},
"markdown": {
"deno": true,
"textWrap": "never"
},
"includes": [
"**/*.{json,jsonc,md,toml,rs,yml,yaml,sh,bash}"
"**/*.{json,jsonc,md,toml,rs,yml,yaml,sh,bash,nix}"
],
"excludes": [
"crates/edgedb_codegen/tests/compile",
Expand All @@ -57,6 +52,8 @@
"plugins": [
"https://plugins.dprint.dev/json-0.19.3.wasm",
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
"https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0"
"https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm",
"https://plugins.dprint.dev/toml-0.6.2.wasm"
]
}
1 change: 0 additions & 1 deletion setup/editors/helix/config.toml

This file was deleted.

Loading

0 comments on commit 23aaafa

Please sign in to comment.