Skip to content

Commit 20cfe9f

Browse files
authored
🧱 Use more GitHub Actions (#543)
* ♻️ Update devcontainer definitions * 🧱 Refactor internal workflows * 🧱 Build nightly on GitHub
1 parent e81ef35 commit 20cfe9f

File tree

4 files changed

+89
-48
lines changed

4 files changed

+89
-48
lines changed

.devcontainer/Dockerfile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
FROM golang:bookworm
1919
ARG TARGETARCH
20+
ARG CLANG=16
21+
ENV TARGETARCH=$TARGETARCH \
22+
CLANG=$CLANG
2023
ENV CHOCO_VERSION=2.2.2 \
2124
GH_VERSION=2.41.0
2225
ENV MONO_REPO="https://download.mono-project.com/repo/debian" \
@@ -57,11 +60,6 @@ RUN set -ex && \
5760
echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco && \
5861
chmod +x /usr/local/bin/choco
5962

60-
# optional: the dependency for the internal needs
61-
RUN curl -fsSL "https://codesign-distribution.labs.jb.gg/codesign-client-linux-$TARGETARCH" \
62-
-o /usr/local/bin/codesign || true && \
63-
chmod +x /usr/local/bin/codesign || true
64-
6563
# optional: gh cli is a must only for publishing the releases
6664
RUN curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_$TARGETARCH.deb" \
6765
-o /tmp/gh.deb && \
@@ -73,7 +71,7 @@ RUN curl -fsSL "https://get.docker.com" | sh
7371
# optional: needed for .net tests
7472
ARG DOTNET_INSTALL_SH_REVISION="40434288dc5bbda41eafcbcbbc5c0fbbe028fb30"
7573
ENV DOTNET_ROOT="/usr/share/dotnet" \
76-
DOTNET_CHANNEL="6.0"
74+
DOTNET_CHANNEL="9.0"
7775
RUN curl -fsSL -o /tmp/dotnet-install.sh \
7876
"https://raw.githubusercontent.com/dotnet/install-scripts/$DOTNET_INSTALL_SH_REVISION/src/dotnet-install.sh" && \
7977
echo "d9ede6126a6da49cd3509e5fc8236f79addf175696f29d01f38840fd84663514 /tmp/dotnet-install.sh" > /tmp/shasum && \
@@ -83,21 +81,21 @@ RUN curl -fsSL -o /tmp/dotnet-install.sh \
8381
chmod 777 -R $DOTNET_ROOT
8482

8583
# optional: needed for cpp tests
86-
ENV CXX="/usr/lib/llvm-16/bin/clang++" \
87-
CC="/usr/lib/llvm-16/bin/clang" \
88-
CPLUS_INCLUDE_PATH="/usr/lib/clang/16/include"
89-
RUN echo "deb https://apt.llvm.org/bookworm llvm-toolchain-bookworm-16 main" \
84+
ENV CXX="/usr/lib/llvm-$CLANG/bin/clang++" \
85+
CC="/usr/lib/llvm-$CLANG/bin/clang" \
86+
CPLUS_INCLUDE_PATH="/usr/lib/clang/$CLANG/include"
87+
RUN echo "deb https://apt.llvm.org/bookworm llvm-toolchain-bookworm-$CLANG main" \
9088
> /etc/apt/sources.list.d/llvm.list && \
9189
wget -qO /etc/apt/trusted.gpg.d/llvm.asc \
9290
https://apt.llvm.org/llvm-snapshot.gpg.key && \
9391
apt-get -qq update && \
9492
apt-get install -qqy -t \
95-
llvm-toolchain-bookworm-16 \
96-
clang-16 clang-tidy-16 \
97-
clang-format-16 lld-16 \
98-
libc++-16-dev \
99-
libc++abi-16-dev && \
100-
for f in /usr/lib/llvm-16/bin/*; do ln -sf "$f" /usr/bin; done && \
93+
llvm-toolchain-bookworm-$CLANG \
94+
clang-$CLANG clang-tidy-$CLANG \
95+
clang-format-$CLANG lld-$CLANG \
96+
libc++-$CLANG-dev \
97+
libc++abi-$CLANG-dev && \
98+
for f in /usr/lib/llvm-$CLANG/bin/*; do ln -sf "$f" /usr/bin; done && \
10199
ln -sf clang /usr/bin/cc && \
102100
ln -sf clang /usr/bin/c89 && \
103101
ln -sf clang /usr/bin/c99 && \

.github/workflows/ci.yml

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,10 @@ jobs:
3535
- name: Overwrite tools (to run tests only on gh repo)
3636
run: |
3737
touch cdnet/clt.zip tooling/baseline-cli.jar tooling/intellij-report-converter.jar tooling/qodana-fuser.jar
38-
cat > go.work << EOF
39-
go 1.24.0
40-
41-
use (
42-
./cdnet
43-
./cli
44-
./cloud
45-
./cmd
46-
./core
47-
./platform
48-
./sarif
49-
./tooling
50-
)
51-
EOF
38+
rm go.work && mv go.work.github go.work
5239
shell: bash
5340
- name: Download config-loader-cli.jar
54-
run: |
55-
chmod +x download_deps.sh
56-
./download_deps.sh
41+
run: chmod +x download_deps.sh && ./download_deps.sh
5742
shell: bash
5843
- name: Set up gotestfmt
5944
uses: gotesttools/gotestfmt-action@v2
@@ -93,21 +78,7 @@ jobs:
9378
- name: Overwrite tools (to run tests only on gh repo)
9479
run: |
9580
touch cdnet/clt.zip tooling/baseline-cli.jar tooling/intellij-report-converter.jar tooling/qodana-fuser.jar
96-
cat > go.work << EOF
97-
go 1.24.0
98-
99-
use (
100-
./cdnet
101-
./cli
102-
./cloud
103-
./cmd
104-
./core
105-
./platform
106-
./sarif
107-
./tooling
108-
)
109-
EOF
110-
shell: bash
81+
rm go.work && mv go.work.github go.work
11182
- uses: docker/login-action@v3
11283
with:
11384
registry: registry.jetbrains.team
@@ -134,6 +105,37 @@ jobs:
134105
- uses: github/codeql-action/autobuild@v3
135106
- uses: github/codeql-action/analyze@v3
136107

108+
release-nightly:
109+
runs-on: sre-eqx-kata
110+
needs: [ test, code-quality ]
111+
container:
112+
image: ghcr.io/jetbrains/qodana-cli/devcontainer:latest
113+
permissions:
114+
checks: write
115+
pull-requests: write
116+
actions: read
117+
contents: write
118+
security-events: write
119+
packages: read
120+
if: github.ref == 'refs/heads/main'
121+
steps:
122+
- uses: actions/checkout@v4
123+
with:
124+
fetch-depth: 0
125+
- name: Overwrite tools (to run tests only on gh repo)
126+
run: |
127+
touch cdnet/clt.zip tooling/baseline-cli.jar tooling/intellij-report-converter.jar tooling/qodana-fuser.jar
128+
rm go.work && mv go.work.github go.work
129+
- run: |
130+
./download_deps.sh
131+
export TARGETARCH=$(uname -m)
132+
curl -fsSL "https://codesign-distribution.labs.jb.gg/codesign-client-linux-$TARGETARCH" -o /usr/local/bin/codesign || true
133+
chmod +x /usr/local/bin/codesign || true
134+
cd cli && goreleaser release --clean --nightly --skip=chocolatey,nfpm,homebrew,scoop,snapcraft
135+
env:
136+
GH_TOKEN: ${{ github.token }}
137+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
138+
137139
# install-script-check:
138140
# strategy:
139141
# fail-fast: false

.github/workflows/devcontainer.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: devcontainer
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
jobs:
14+
docker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: docker/login-action@v3
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
- uses: docker/setup-qemu-action@v3
24+
- uses: docker/setup-buildx-action@v3
25+
- uses: docker/build-push-action@v6
26+
with:
27+
context: .devcontainer
28+
push: true
29+
tags: ghcr.io/jetbrains/qodana-cli/devcontainer:latest

go.work.github

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
go 1.24.0
2+
3+
use (
4+
./cdnet
5+
./cli
6+
./cloud
7+
./cmd
8+
./core
9+
./platform
10+
./sarif
11+
./tooling
12+
)

0 commit comments

Comments
 (0)