Skip to content

Commit 7c41db6

Browse files
author
wu-kan
committed
11.0.6.20220730: replace exit with sys.exit
1 parent 42bb62a commit 7c41db6

File tree

7 files changed

+117
-6
lines changed

7 files changed

+117
-6
lines changed

.github/workflows/docker.yml renamed to .github/workflows/docker-latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker
1+
name: docker-latest
22

33
# This workflow uses actions that are not certified by GitHub.
44
# They are provided by a third-party and are governed by
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: docker-unstable-slim
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
push:
10+
branches: [unstable-slim]
11+
tags: ["*"]
12+
pull_request:
13+
branches: [unstable-slim]
14+
15+
env:
16+
# Use docker.io for Docker Hub if empty
17+
REGISTRY: docker.io
18+
# github.repository as <account>/<repo>
19+
IMAGE_NAME: wukan0621/sysu-lang
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
packages: write
27+
# This is used to complete the identity challenge
28+
# with sigstore/fulcio when running outside of PRs.
29+
id-token: write
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v3
34+
with:
35+
submodules: false
36+
37+
# Extract metadata (tags, labels) for Docker
38+
# https://github.com/docker/metadata-action
39+
- name: Extract Docker metadata
40+
id: meta
41+
uses: docker/metadata-action@v4
42+
with:
43+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44+
45+
# Workaround: https://github.com/docker/build-push-action/issues/461
46+
- name: Setup Docker buildx
47+
uses: docker/setup-buildx-action@v2
48+
49+
# Build Docker image with Buildx
50+
# https://github.com/docker/build-push-action
51+
- name: Build Docker image
52+
id: build
53+
uses: docker/build-push-action@v3
54+
with:
55+
context: .
56+
load: true
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
60+
- name: Run Tests
61+
uses: addnab/docker-run-action@v3
62+
continue-on-error: true
63+
with:
64+
image: ${{ steps.meta.outputs.tags }}
65+
run: |
66+
export CTEST_OUTPUT_ON_FAILURE=1
67+
cmake --build ~/sysu/build -t test
68+
69+
# Login against a Docker registry except on PR
70+
# https://github.com/docker/login-action
71+
- name: Log into registry ${{ env.REGISTRY }}
72+
if: github.event_name != 'pull_request'
73+
uses: docker/login-action@v2
74+
with:
75+
registry: ${{ env.REGISTRY }}
76+
username: ${{ secrets.DOCKER_USERNAME }}
77+
password: ${{ secrets.DOCKER_PASSWORD }}
78+
79+
- name: Setup Docker qemu
80+
uses: docker/setup-qemu-action@v2
81+
82+
# Build and push Docker image with Buildx (don't push on PR)
83+
# https://github.com/docker/build-push-action
84+
- name: Build and push Docker image
85+
id: build-and-push
86+
uses: docker/build-push-action@v3
87+
with:
88+
platforms: linux/amd64,linux/arm64,linux/riscv64
89+
context: .
90+
push: ${{ github.event_name != 'pull_request' }}
91+
tags: ${{ steps.meta.outputs.tags }}
92+
labels: ${{ steps.meta.outputs.labels }}
93+
94+
# Install the cosign tool except on PR
95+
# https://github.com/sigstore/cosign-installer
96+
- name: Install cosign
97+
if: github.event_name != 'pull_request'
98+
uses: sigstore/[email protected]
99+
100+
# Sign the resulting Docker image digest except on PRs.
101+
# This will only write to the public Rekor transparency log when the Docker
102+
# repository is public to avoid leaking data. If you would like to publish
103+
# transparency data even for private images, pass --force to cosign below.
104+
# https://github.com/sigstore/cosign
105+
- name: Sign the published Docker image
106+
if: ${{ github.event_name != 'pull_request' }}
107+
env:
108+
COSIGN_EXPERIMENTAL: "true"
109+
# This step uses the identity token to provision an ephemeral certificate
110+
# against the sigstore community Fulcio instance.
111+
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.18.4)
2-
project(SYsU-lang VERSION 11.0.5.20220525)
2+
project(SYsU-lang VERSION 11.0.6.20220730)
33
include(CPack)
44
include(CTest)
55
add_subdirectory(compiler)

compiler/sysu-compiler

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,4 +533,4 @@ def main(*argv):
533533

534534

535535
if __name__ == '__main__':
536-
exit(main(*sys.argv))
536+
sys.exit(main(*sys.argv))

linker/sysu-linker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def main(*argv):
2525

2626

2727
if __name__ == '__main__':
28-
exit(main(*sys.argv))
28+
sys.exit(main(*sys.argv))

preprocessor/sysu-preprocessor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def main(*argv):
2525

2626

2727
if __name__ == '__main__':
28-
exit(main(*sys.argv))
28+
sys.exit(main(*sys.argv))

translator/sysu-translator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def main(*argv):
2525

2626

2727
if __name__ == '__main__':
28-
exit(main(*sys.argv))
28+
sys.exit(main(*sys.argv))

0 commit comments

Comments
 (0)